From 99bd6762284ba316d619103907ef8b9cf3062f51 Mon Sep 17 00:00:00 2001 From: Jeremyzz Date: Thu, 18 May 2023 14:31:12 +0800 Subject: [PATCH] Variable naming modification to remove useless functions Signed-off-by: Jeremyzz --- .../data_share/gaussdb_rd/src/common/include/document_type.h | 2 +- .../data_share/gaussdb_rd/src/interface/include/result_set.h | 1 - .../gaussdb_rd/src/interface/src/document_store.cpp | 2 +- .../data_share/gaussdb_rd/src/interface/src/result_set.cpp | 4 ++-- .../gaussdb_rd/src/interface/src/result_set_common.cpp | 2 +- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/services/distributeddataservice/service/data_share/gaussdb_rd/src/common/include/document_type.h b/services/distributeddataservice/service/data_share/gaussdb_rd/src/common/include/document_type.h index 69c95c0e..ff525ecb 100644 --- a/services/distributeddataservice/service/data_share/gaussdb_rd/src/common/include/document_type.h +++ b/services/distributeddataservice/service/data_share/gaussdb_rd/src/common/include/document_type.h @@ -24,7 +24,7 @@ namespace DocumentDB { struct QueryContext { std::string collectionName; std::string filter; - std::vector> path; + std::vector> projectionPath; ProjectionTree projectionTree; bool ifShowId = false; bool viewType = false; diff --git a/services/distributeddataservice/service/data_share/gaussdb_rd/src/interface/include/result_set.h b/services/distributeddataservice/service/data_share/gaussdb_rd/src/interface/include/result_set.h index aa2cbb32..65956e09 100644 --- a/services/distributeddataservice/service/data_share/gaussdb_rd/src/interface/include/result_set.h +++ b/services/distributeddataservice/service/data_share/gaussdb_rd/src/interface/include/result_set.h @@ -44,7 +44,6 @@ private: int GetNextWithField(); DocumentStore *store_ = nullptr; - ValueObject key_; bool ifField_ = false; size_t index_ = 0; std::shared_ptr context_; diff --git a/services/distributeddataservice/service/data_share/gaussdb_rd/src/interface/src/document_store.cpp b/services/distributeddataservice/service/data_share/gaussdb_rd/src/interface/src/document_store.cpp index d6fe2935..fc4151a1 100644 --- a/services/distributeddataservice/service/data_share/gaussdb_rd/src/interface/src/document_store.cpp +++ b/services/distributeddataservice/service/data_share/gaussdb_rd/src/interface/src/document_store.cpp @@ -640,7 +640,7 @@ int FindProjectionInit(const std::string &projection, std::shared_ptrpath = std::move(allPath); + context->projectionPath = std::move(allPath); context->viewType = viewType; return errCode; } diff --git a/services/distributeddataservice/service/data_share/gaussdb_rd/src/interface/src/result_set.cpp b/services/distributeddataservice/service/data_share/gaussdb_rd/src/interface/src/result_set.cpp index bfba1da5..5dc1741a 100644 --- a/services/distributeddataservice/service/data_share/gaussdb_rd/src/interface/src/result_set.cpp +++ b/services/distributeddataservice/service/data_share/gaussdb_rd/src/interface/src/result_set.cpp @@ -223,14 +223,14 @@ int ResultSet::CutJsonBranch(std::string &jsonData) GLOGE("The node in CheckCutNode is nullptr"); return errCode; } - for (const auto & singleCutPaht : allCutPath) { + for (const auto &singleCutPaht : allCutPath) { if (!context_->ifShowId || singleCutPaht[0] != KEY_ID) { cjsonObj.DeleteItemDeeplyOnTarget(singleCutPaht); } } } if (!context_->viewType) { - for (const auto & singleCutPaht : context_->path) { // projection Path + for (const auto &singleCutPaht : context_->projectionPath) { cjsonObj.DeleteItemDeeplyOnTarget(singleCutPaht); } if (!context_->ifShowId) { diff --git a/services/distributeddataservice/service/data_share/gaussdb_rd/src/interface/src/result_set_common.cpp b/services/distributeddataservice/service/data_share/gaussdb_rd/src/interface/src/result_set_common.cpp index 74b41d0a..e0b9bc24 100644 --- a/services/distributeddataservice/service/data_share/gaussdb_rd/src/interface/src/result_set_common.cpp +++ b/services/distributeddataservice/service/data_share/gaussdb_rd/src/interface/src/result_set_common.cpp @@ -26,7 +26,7 @@ class ValueObject; int InitResultSet(std::shared_ptr &context, DocumentStore *store, ResultSet &resultSet, bool ifField) { if (ifField == false) { - if (context->projectionTree.ParseTree(context->path) == -E_INVALID_ARGS) { + if (context->projectionTree.ParseTree(context->projectionPath) == -E_INVALID_ARGS) { GLOGE("Parse ProjectionTree failed"); return -E_INVALID_ARGS; } -- Gitee