Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix dep of loop in go planner #4736

Merged
merged 1 commit into from
Oct 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 | | |