Skip to content

Commit

Permalink
Fix argument get error input data.
Browse files Browse the repository at this point in the history
  • Loading branch information
CPWstatic committed Dec 27, 2021
1 parent 43febea commit 65d3f4c
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 19 deletions.
14 changes: 14 additions & 0 deletions src/graph/context/Iterator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,20 @@ void SequentialIter::doReset(size_t pos) {
iter_ = rows_->begin() + pos;
}

const Value& SequentialIter::getColumn(const std::string& col) const {
if (!valid()) {
return Value::kNullValue;
}
auto& row = *iter_;
auto index = colIndices_.find(col);
if (index == colIndices_.end()) {
return Value::kNullValue;
}

DCHECK_LT(index->second, row.values.size()) << "index: " << index->second << " row" << row;
return row.values[index->second];
}

const Value& SequentialIter::getColumn(int32_t index) const {
return getColumnByIndex(index, iter_);
}
Expand Down
14 changes: 1 addition & 13 deletions src/graph/context/Iterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -465,19 +465,7 @@ class SequentialIter : public Iterator {
return rows_->size();
}

const Value& getColumn(const std::string& col) const override {
if (!valid()) {
return Value::kNullValue;
}
auto& row = *iter_;
auto index = colIndices_.find(col);
if (index == colIndices_.end()) {
return Value::kNullValue;
}

DCHECK_LT(index->second, row.values.size());
return row.values[index->second];
}
const Value& getColumn(const std::string& col) const override;

const Value& getColumn(int32_t index) const override;

Expand Down
4 changes: 3 additions & 1 deletion src/graph/executor/query/TraverseExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ Status TraverseExecutor::buildRequestDataSet() {
<< ", space vid type: " << SchemaUtil::typeToString(vidType);
continue;
}
buildPath(prev, vid, iter->moveRow());
// Need copy here, Argument executor may depends on this variable.
auto prePath = *iter->row();
buildPath(prev, vid, std::move(prePath));
if (!uniqueSet.emplace(vid).second) {
continue;
}
Expand Down
5 changes: 0 additions & 5 deletions src/graph/scheduler/AsyncMsgNotifyBasedScheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,7 @@ folly::Future<Status> AsyncMsgNotifyBasedScheduler::doSchedule(Executor* root) c
if (exe->node()->kind() == PlanNode::Kind::kArgument) {
auto nodeInputVar = exe->node()->inputVar();
const auto& writtenBy = qctx_->symTable()->getVar(nodeInputVar)->writtenBy;
VLOG(1) << "var: " << nodeInputVar
<< "refCount: " << qctx_->symTable()->getVar(nodeInputVar)->userCount.load()
<< "writtenBy: " << writtenBy.size() << " if Exist this node: "
<< (writtenBy.find(const_cast<PlanNode*>(exe->node())) != writtenBy.end());
for (auto& node : writtenBy) {
VLOG(1) << "register notifier to: " << node->id();
folly::Promise<Status> p;
futures.emplace_back(p.getFuture());
auto& promises = promiseMap[node->id()];
Expand Down

0 comments on commit 65d3f4c

Please sign in to comment.