Skip to content

Commit

Permalink
modify subgraph loop condition (#4226)
Browse files Browse the repository at this point in the history
* modify loop condition

* fix error
  • Loading branch information
nevermore3 authored May 6, 2022
1 parent 326b856 commit a58d945
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/graph/planner/ngql/SubgraphPlanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,11 @@ StatusOr<SubPlan> SubgraphPlanner::nSteps(SubPlan& startVidPlan, const std::stri
subgraph->setOutputVar(input);
subgraph->setBiDirectEdgeTypes(subgraphCtx_->biDirectEdgeTypes);
subgraph->setColNames({nebula::kVid});

auto* condition = loopCondition(steps.steps() + 1, gn->outputVar());
uint32_t maxSteps = steps.steps();
if (subgraphCtx_->getEdgeProp || subgraphCtx_->withProp) {
++maxSteps;
}
auto* condition = loopCondition(maxSteps, gn->outputVar());
auto* loop = Loop::make(qctx, startVidPlan.root, subgraph, condition);

auto* dc = DataCollect::make(qctx, DataCollect::DCKind::kSubgraph);
Expand Down

0 comments on commit a58d945

Please sign in to comment.