diff --git a/src/graph/optimizer/rule/RemoveNoopProjectRule.cpp b/src/graph/optimizer/rule/RemoveNoopProjectRule.cpp index e3b79b30903..afaad5b80cd 100644 --- a/src/graph/optimizer/rule/RemoveNoopProjectRule.cpp +++ b/src/graph/optimizer/rule/RemoveNoopProjectRule.cpp @@ -55,6 +55,7 @@ namespace opt { PlanNode::Kind::kSubgraph, PlanNode::Kind::kDataCollect, PlanNode::Kind::kLeftJoin, + PlanNode::Kind::kUnwind, PlanNode::Kind::kInnerJoin, PlanNode::Kind::kBiLeftJoin, PlanNode::Kind::kBiInnerJoin, diff --git a/src/graph/planner/plan/Query.cpp b/src/graph/planner/plan/Query.cpp index aa1c8bed387..a03841b8d4d 100644 --- a/src/graph/planner/plan/Query.cpp +++ b/src/graph/planner/plan/Query.cpp @@ -369,6 +369,7 @@ std::unique_ptr Unwind::explain() const { PlanNode* Unwind::clone() const { auto* newUnwind = Unwind::make(qctx_, nullptr); + newUnwind->setFromPipe(fromPipe_); newUnwind->cloneMembers(*this); return newUnwind; } diff --git a/src/graph/planner/plan/Query.h b/src/graph/planner/plan/Query.h index 0f74d65dc68..c10cf992f9b 100644 --- a/src/graph/planner/plan/Query.h +++ b/src/graph/planner/plan/Query.h @@ -845,8 +845,8 @@ class Unwind final : public SingleInputNode { return fromPipe_; } - void setFromPipe() { - fromPipe_ = true; + void setFromPipe(bool fromPipe) { + fromPipe_ = fromPipe; } PlanNode* clone() const override; diff --git a/src/graph/validator/UnwindValidator.cpp b/src/graph/validator/UnwindValidator.cpp index c653b49918e..6cee4c8886d 100644 --- a/src/graph/validator/UnwindValidator.cpp +++ b/src/graph/validator/UnwindValidator.cpp @@ -41,7 +41,7 @@ Status UnwindValidator::validateImpl() { Status UnwindValidator::toPlan() { auto *unwind = Unwind::make(qctx_, nullptr, unwindExpr_, alias_); unwind->setColNames({alias_}); - unwind->setFromPipe(); + unwind->setFromPipe(true); root_ = tail_ = unwind; return Status::OK(); }