From a46083204d14a2ecb40acb124ecd0f2a018a2df4 Mon Sep 17 00:00:00 2001 From: Shylock Hg <33566796+Shylock-Hg@users.noreply.github.com> Date: Mon, 9 May 2022 11:40:03 +0800 Subject: [PATCH] GetNeighborsIter could get size now. --- src/graph/executor/Executor.cpp | 2 +- src/graph/executor/StorageAccessExecutor.cpp | 2 +- src/graph/executor/query/ProjectExecutor.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/graph/executor/Executor.cpp b/src/graph/executor/Executor.cpp index 37706f21c6a..2bb80673e3c 100644 --- a/src/graph/executor/Executor.cpp +++ b/src/graph/executor/Executor.cpp @@ -685,7 +685,7 @@ void Executor::dropBody(const PlanNode *body) { Status Executor::finish(Result &&result) { if (!FLAGS_enable_lifetime_optimize || node()->outputVarPtr()->userCount.load(std::memory_order_relaxed) != 0) { - numRows_ = !result.iterRef()->isGetNeighborsIter() ? result.size() : 0; + numRows_ = result.size(); result.checkMemory(node()->isQueryNode()); ectx_->setResult(node()->outputVar(), std::move(result)); } else { diff --git a/src/graph/executor/StorageAccessExecutor.cpp b/src/graph/executor/StorageAccessExecutor.cpp index 00c29e5226e..48fcdb58d3f 100644 --- a/src/graph/executor/StorageAccessExecutor.cpp +++ b/src/graph/executor/StorageAccessExecutor.cpp @@ -44,7 +44,7 @@ DataSet buildRequestDataSet(const SpaceInfo &space, bool dedup) { DCHECK(iter && expr) << "iter=" << iter << ", expr=" << expr; nebula::DataSet vertices({kVid}); - auto s = !iter->isGetNeighborsIter() ? iter->size() : 0; + auto s = iter->size(); vertices.rows.reserve(s); std::unordered_set uniqueSet; diff --git a/src/graph/executor/query/ProjectExecutor.cpp b/src/graph/executor/query/ProjectExecutor.cpp index b4f80b9b484..91615f18937 100644 --- a/src/graph/executor/query/ProjectExecutor.cpp +++ b/src/graph/executor/query/ProjectExecutor.cpp @@ -19,7 +19,7 @@ folly::Future ProjectExecutor::execute() { DataSet ds; ds.colNames = project->colNames(); - ds.rows.reserve(!iter->isGetNeighborsIter() ? iter->size() : 0); + ds.rows.reserve(iter->size()); for (; iter->valid(); iter->next()) { Row row; for (auto& col : columns) {