From fe18ee8aec6dc0b62af5fd9b58f303520ce25cef Mon Sep 17 00:00:00 2001 From: jimingquan Date: Tue, 19 Oct 2021 14:00:27 +0800 Subject: [PATCH 1/2] fix go mTOn filter bug --- src/graph/planner/ngql/GoPlanner.cpp | 2 +- tests/tck/features/go/GO.IntVid.feature | 16 ++++++++++++++++ tests/tck/features/go/GO.feature | 16 ++++++++++++++++ 3 files changed, 33 insertions(+), 1 deletion(-) diff --git a/src/graph/planner/ngql/GoPlanner.cpp b/src/graph/planner/ngql/GoPlanner.cpp index fc0a38ddda3..aa747c2063d 100644 --- a/src/graph/planner/ngql/GoPlanner.cpp +++ b/src/graph/planner/ngql/GoPlanner.cpp @@ -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); loopBody->setColNames(std::move(goCtx_->colNames)); diff --git a/tests/tck/features/go/GO.IntVid.feature b/tests/tck/features/go/GO.IntVid.feature index 1bb89bfca70..cf61ebef3cb 100644 --- a/tests/tck/features/go/GO.IntVid.feature +++ b/tests/tck/features/go/GO.IntVid.feature @@ -1434,6 +1434,22 @@ 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 + """ + 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}] | Scenario: Integer Vid error message When executing query: diff --git a/tests/tck/features/go/GO.feature b/tests/tck/features/go/GO.feature index 6f46375ec5e..21b5cbdd24b 100644 --- a/tests/tck/features/go/GO.feature +++ b/tests/tck/features/go/GO.feature @@ -1490,6 +1490,22 @@ 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}] | Scenario: error message When executing query: From 85974954b9fcd8110d745d504628c080f62b9b43 Mon Sep 17 00:00:00 2001 From: jimingquan Date: Tue, 19 Oct 2021 14:31:02 +0800 Subject: [PATCH 2/2] add test case --- tests/tck/features/go/GO.IntVid.feature | 23 +++++++++++++++++++++++ tests/tck/features/go/GO.feature | 23 +++++++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/tests/tck/features/go/GO.IntVid.feature b/tests/tck/features/go/GO.IntVid.feature index cf61ebef3cb..10636afa173 100644 --- a/tests/tck/features/go/GO.IntVid.feature +++ b/tests/tck/features/go/GO.IntVid.feature @@ -1450,6 +1450,29 @@ Feature: IntegerVid Go Sentence | 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: diff --git a/tests/tck/features/go/GO.feature b/tests/tck/features/go/GO.feature index 21b5cbdd24b..7eef941ae94 100644 --- a/tests/tck/features/go/GO.feature +++ b/tests/tck/features/go/GO.feature @@ -1506,6 +1506,29 @@ Feature: Go Sentence | 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: