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 go mTOn filter bug #3144

Merged
merged 5 commits into from
Oct 20, 2021
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 @@ -504,7 +504,7 @@ SubPlan GoPlanner::mToNStepsPlan(SubPlan& startVidPlan) {
}

const auto& projectInput =
(joinInput || joinDst) ? loopBody->outputVar() : sampleLimit->outputVar();
(loopBody != getDst) ? loopBody->outputVar() : sampleLimit->outputVar();
loopBody = Project::make(qctx, loopBody, goCtx_->yieldExpr);
loopBody->setInputVar(projectInput);
Comment on lines 506 to 509
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not delete these codes?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

execution flow and data flow are sometimes inconsistent, so explicit input is required

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still think there is redundant code logic and the Project node has nothing to do with getDst

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

loopbody may be getDst or filter, but the input of project can only be sample or filter, This is why you need to specify the project's input

loopBody->setColNames(std::move(goCtx_->colNames));
Expand Down
39 changes: 39 additions & 0 deletions tests/tck/features/go/GO.IntVid.feature
Original file line number Diff line number Diff line change
Expand Up @@ -1434,6 +1434,45 @@ Feature: IntegerVid Go Sentence
| EMPTY | "Russell Westbrook" |
| EMPTY | "Luka Doncic" |
| EMPTY | "Russell Westbrook" |
When executing query:
"""
go 1 to 4 steps from hash("Tim Duncan") over like where like.likeness > 90 yield like.likeness, edge as e
nevermore3 marked this conversation as resolved.
Show resolved Hide resolved
"""
Then the result should be, in any order, with relax comparison:
| like.likeness | e |
| 95 | [:like "Tim Duncan"->"Manu Ginobili" @0 {likeness: 95}] |
| 95 | [:like "Tim Duncan"->"Tony Parker" @0 {likeness: 95}] |
| 95 | [:like "Tony Parker"->"Manu Ginobili" @0 {likeness: 95}] |
| 95 | [:like "Tony Parker"->"Tim Duncan" @0 {likeness: 95}] |
| 95 | [:like "Tim Duncan"->"Manu Ginobili" @0 {likeness: 95}] |
| 95 | [:like "Tim Duncan"->"Tony Parker" @0 {likeness: 95}] |
| 95 | [:like "Tony Parker"->"Manu Ginobili" @0 {likeness: 95}] |
| 95 | [:like "Tony Parker"->"Tim Duncan" @0 {likeness: 95}] |
| 95 | [:like "Tim Duncan"->"Manu Ginobili" @0 {likeness: 95}] |
| 95 | [:like "Tim Duncan"->"Tony Parker" @0 {likeness: 95}] |
When executing query:
"""
go 1 to 4 steps from hash("Tim Duncan") over like yield like.likeness, edge as e
"""
Then the result should be, in any order, with relax comparison:
| like.likeness | e |
| 95 | [:like "Tim Duncan"->"Manu Ginobili" @0 {likeness: 95}] |
| 95 | [:like "Tim Duncan"->"Tony Parker" @0 {likeness: 95}] |
| 90 | [:like "Manu Ginobili"->"Tim Duncan" @0 {likeness: 90}] |
| 90 | [:like "Tony Parker"->"LaMarcus Aldridge" @0 {likeness: 90}] |
| 95 | [:like "Tony Parker"->"Manu Ginobili" @0 {likeness: 95}] |
| 95 | [:like "Tony Parker"->"Tim Duncan" @0 {likeness: 95}] |
| 75 | [:like "LaMarcus Aldridge"->"Tim Duncan" @0 {likeness: 75}] |
| 75 | [:like "LaMarcus Aldridge"->"Tony Parker" @0 {likeness: 75}] |
| 95 | [:like "Tim Duncan"->"Manu Ginobili" @0 {likeness: 95}] |
| 95 | [:like "Tim Duncan"->"Tony Parker" @0 {likeness: 95}] |
| 90 | [:like "Manu Ginobili"->"Tim Duncan" @0 {likeness: 90}] |
| 90 | [:like "Tony Parker"->"LaMarcus Aldridge" @0 {likeness: 90}] |
| 95 | [:like "Tony Parker"->"Manu Ginobili" @0 {likeness: 95}] |
| 95 | [:like "Tony Parker"->"Tim Duncan" @0 {likeness: 95}] |
| 95 | [:like "Tim Duncan"->"Manu Ginobili" @0 {likeness: 95}] |
| 95 | [:like "Tim Duncan"->"Tony Parker" @0 {likeness: 95}] |
| 90 | [:like "Manu Ginobili"->"Tim Duncan" @0 {likeness: 90}] |

Scenario: Integer Vid error message
When executing query:
Expand Down
39 changes: 39 additions & 0 deletions tests/tck/features/go/GO.feature
Original file line number Diff line number Diff line change
Expand Up @@ -1490,6 +1490,45 @@ Feature: Go Sentence
| EMPTY | "Russell Westbrook" |
| EMPTY | "Luka Doncic" |
| EMPTY | "Russell Westbrook" |
When executing query:
"""
go 1 to 4 steps from "Tim Duncan" over like where like.likeness > 90 yield like.likeness, edge as e
"""
Then the result should be, in any order, with relax comparison:
| like.likeness | e |
| 95 | [:like "Tim Duncan"->"Manu Ginobili" @0 {likeness: 95}] |
| 95 | [:like "Tim Duncan"->"Tony Parker" @0 {likeness: 95}] |
| 95 | [:like "Tony Parker"->"Manu Ginobili" @0 {likeness: 95}] |
| 95 | [:like "Tony Parker"->"Tim Duncan" @0 {likeness: 95}] |
| 95 | [:like "Tim Duncan"->"Manu Ginobili" @0 {likeness: 95}] |
| 95 | [:like "Tim Duncan"->"Tony Parker" @0 {likeness: 95}] |
| 95 | [:like "Tony Parker"->"Manu Ginobili" @0 {likeness: 95}] |
| 95 | [:like "Tony Parker"->"Tim Duncan" @0 {likeness: 95}] |
| 95 | [:like "Tim Duncan"->"Manu Ginobili" @0 {likeness: 95}] |
| 95 | [:like "Tim Duncan"->"Tony Parker" @0 {likeness: 95}] |
When executing query:
"""
go 1 to 4 steps from "Tim Duncan" over like yield like.likeness, edge as e
"""
Then the result should be, in any order, with relax comparison:
| like.likeness | e |
| 95 | [:like "Tim Duncan"->"Manu Ginobili" @0 {likeness: 95}] |
| 95 | [:like "Tim Duncan"->"Tony Parker" @0 {likeness: 95}] |
| 90 | [:like "Manu Ginobili"->"Tim Duncan" @0 {likeness: 90}] |
| 90 | [:like "Tony Parker"->"LaMarcus Aldridge" @0 {likeness: 90}] |
| 95 | [:like "Tony Parker"->"Manu Ginobili" @0 {likeness: 95}] |
| 95 | [:like "Tony Parker"->"Tim Duncan" @0 {likeness: 95}] |
| 75 | [:like "LaMarcus Aldridge"->"Tim Duncan" @0 {likeness: 75}] |
| 75 | [:like "LaMarcus Aldridge"->"Tony Parker" @0 {likeness: 75}] |
| 95 | [:like "Tim Duncan"->"Manu Ginobili" @0 {likeness: 95}] |
| 95 | [:like "Tim Duncan"->"Tony Parker" @0 {likeness: 95}] |
| 90 | [:like "Manu Ginobili"->"Tim Duncan" @0 {likeness: 90}] |
| 90 | [:like "Tony Parker"->"LaMarcus Aldridge" @0 {likeness: 90}] |
| 95 | [:like "Tony Parker"->"Manu Ginobili" @0 {likeness: 95}] |
| 95 | [:like "Tony Parker"->"Tim Duncan" @0 {likeness: 95}] |
| 95 | [:like "Tim Duncan"->"Manu Ginobili" @0 {likeness: 95}] |
| 95 | [:like "Tim Duncan"->"Tony Parker" @0 {likeness: 95}] |
| 90 | [:like "Manu Ginobili"->"Tim Duncan" @0 {likeness: 90}] |

Scenario: error message
When executing query:
Expand Down