Skip to content

Commit

Permalink
fix error
Browse files Browse the repository at this point in the history
  • Loading branch information
nevermore3 committed Jul 23, 2022
1 parent 71f6901 commit 796131c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/graph/executor/query/UnwindExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ folly::Future<Status> UnwindExecutor::execute() {
std::vector<Value> vals = extractList(list);
for (auto &v : vals) {
Row row;
if (!emptyInput) {
if (!unwind->fromPipe() && !emptyInput) {
row = *(iter->row());
}
row.values.emplace_back(std::move(v));
Expand Down
9 changes: 9 additions & 0 deletions src/graph/planner/plan/Query.h
Original file line number Diff line number Diff line change
Expand Up @@ -841,6 +841,14 @@ class Unwind final : public SingleInputNode {
return alias_;
}

bool fromPipe() const {
return fromPipe_;
}

void setFromPipe() {
fromPipe_ = true;
}

PlanNode* clone() const override;
std::unique_ptr<PlanNodeDescription> explain() const override;

Expand All @@ -854,6 +862,7 @@ class Unwind final : public SingleInputNode {
private:
Expression* unwindExpr_{nullptr};
std::string alias_;
bool fromPipe_{false};
};

// Sort the given record set.
Expand Down
1 change: 1 addition & 0 deletions src/graph/validator/UnwindValidator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Status UnwindValidator::validateImpl() {
Status UnwindValidator::toPlan() {
auto *unwind = Unwind::make(qctx_, nullptr, unwindExpr_, alias_);
unwind->setColNames({alias_});
unwind->setFromPipe();
root_ = tail_ = unwind;
return Status::OK();
}
Expand Down

0 comments on commit 796131c

Please sign in to comment.