Skip to content

Commit

Permalink
fix dep of loop in go planner
Browse files Browse the repository at this point in the history
  • Loading branch information
jievince committed Oct 17, 2022
1 parent 6f551dc commit c1ae2ef
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/graph/planner/ngql/GoPlanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ SubPlan GoPlanner::nStepsPlan(SubPlan& startVidPlan) {
}

PlanNode* loopBody = getDst;
PlanNode* loopDep = nullptr;
PlanNode* loopDep = startVidPlan.root;
if (goCtx_->joinInput) {
auto* joinLeft = extractVidFromRuntimeInput(startVidPlan.root);
auto* joinRight = extractSrcDstFromGN(getDst, sampleLimit->outputVar());
Expand Down
21 changes: 21 additions & 0 deletions tests/tck/features/go/SimpleCase.feature
Original file line number Diff line number Diff line change
Expand Up @@ -240,3 +240,24 @@ Feature: Simple case
| 2 | Dedup | 1 | |
| 1 | GetDstBySrc | 0 | |
| 0 | Start | | |
When profiling query:
"""
GO 1 STEP FROM "Tony Parker" OVER * YIELD distinct id($$) as id| GO 3 STEP FROM $-.id OVER * YIELD distinct id($$) | YIELD COUNT(*)
"""
Then the result should be, in any order, with relax comparison:
| COUNT(*) |
| 22 |
And the execution plan should be:
| id | name | dependencies | operator info |
| 11 | Aggregate | 10 | |
| 10 | Dedup | 9 | |
| 9 | GetDstBySrc | 8 | |
| 8 | Loop | 4 | {"loopBody": "7"} |
| 7 | Dedup | 6 | |
| 6 | GetDstBySrc | 5 | |
| 5 | Start | | |
| 4 | Dedup | 3 | |
| 3 | Project | 2 | |
| 2 | Dedup | 1 | |
| 1 | GetDstBySrc | 0 | |
| 0 | Start | | |

0 comments on commit c1ae2ef

Please sign in to comment.