From f84da9da282b26013e71e62947d7c0f58142da43 Mon Sep 17 00:00:00 2001 From: jimingquan Date: Sun, 24 Jul 2022 00:25:24 +0800 Subject: [PATCH] fix test error --- .../optimizer/rule/RemoveNoopProjectRule.cpp | 1 - .../features/match/PipeAndVariable.feature | 60 ++++++++++++++++--- 2 files changed, 52 insertions(+), 9 deletions(-) diff --git a/src/graph/optimizer/rule/RemoveNoopProjectRule.cpp b/src/graph/optimizer/rule/RemoveNoopProjectRule.cpp index 91baafe1502..e3b79b30903 100644 --- a/src/graph/optimizer/rule/RemoveNoopProjectRule.cpp +++ b/src/graph/optimizer/rule/RemoveNoopProjectRule.cpp @@ -41,7 +41,6 @@ namespace opt { // PlanNode::Kind::kIntersect, intersect has no value in result // PlanNode::Kind::kMinus, minus has no value in result PlanNode::Kind::kProject, - PlanNode::Kind::kUnwind, PlanNode::Kind::kSort, PlanNode::Kind::kTopN, // PlanNode::Kind::kLimit, limit has no value in result diff --git a/tests/tck/features/match/PipeAndVariable.feature b/tests/tck/features/match/PipeAndVariable.feature index 8a0f8cfb1b2..c97f0c672b4 100644 --- a/tests/tck/features/match/PipeAndVariable.feature +++ b/tests/tck/features/match/PipeAndVariable.feature @@ -84,21 +84,65 @@ Feature: Pipe or use variable to store the lookup results LOOKUP ON player WHERE player.name == 'Tim Duncan' YIELD player.age as age, id(vertex) as vid - | UNWIND $-.vid as a RETURN a + | UNWIND $-.vid as a | YIELD $-.a AS id """ - Then a SyntaxError should be raised at runtime: syntax error near `UNWIND' + Then the result should be, in any order, with relax comparison: + | id | + | "Tim Duncan" | When executing query: """ GET SUBGRAPH 2 STEPS FROM "Tim Duncan" BOTH like YIELD edges as e - | UNWIND $-.e as a RETURN a - """ - Then a SyntaxError should be raised at runtime: syntax error near `UNWIND' + | UNWIND $-.e as a | YIELD $-.a AS a + """ + Then the result should be, in any order, with relax comparison: + | a | + | [:like "Aron Baynes"->"Tim Duncan" @0 {}] | + | [:like "Boris Diaw"->"Tim Duncan" @0 {}] | + | [:like "Danny Green"->"Tim Duncan" @0 {}] | + | [:like "Dejounte Murray"->"Tim Duncan" @0 {}] | + | [:like "LaMarcus Aldridge"->"Tim Duncan" @0 {}] | + | [:like "Manu Ginobili"->"Tim Duncan" @0 {}] | + | [:like "Marco Belinelli"->"Tim Duncan" @0 {}] | + | [:like "Shaquille O'Neal"->"Tim Duncan" @0 {}] | + | [:like "Tiago Splitter"->"Tim Duncan" @0 {}] | + | [:like "Tony Parker"->"Tim Duncan" @0 {}] | + | [:like "Tim Duncan"->"Manu Ginobili" @0 {}] | + | [:like "Tim Duncan"->"Tony Parker" @0 {}] | + | [:like "Damian Lillard"->"LaMarcus Aldridge" @0 {}] | + | [:like "Rudy Gay"->"LaMarcus Aldridge" @0 {}] | + | [:like "LaMarcus Aldridge"->"Tony Parker" @0 {}] | + | [:like "Boris Diaw"->"Tony Parker" @0 {}] | + | [:like "Dejounte Murray"->"Chris Paul" @0 {}] | + | [:like "Dejounte Murray"->"Danny Green" @0 {}] | + | [:like "Dejounte Murray"->"James Harden" @0 {}] | + | [:like "Dejounte Murray"->"Kevin Durant" @0 {}] | + | [:like "Dejounte Murray"->"Kyle Anderson" @0 {}] | + | [:like "Dejounte Murray"->"LeBron James" @0 {}] | + | [:like "Dejounte Murray"->"Manu Ginobili" @0 {}] | + | [:like "Dejounte Murray"->"Marco Belinelli" @0 {}] | + | [:like "Dejounte Murray"->"Russell Westbrook" @0 {}] | + | [:like "Dejounte Murray"->"Tony Parker" @0 {}] | + | [:like "Danny Green"->"LeBron James" @0 {}] | + | [:like "Danny Green"->"Marco Belinelli" @0 {}] | + | [:like "Marco Belinelli"->"Danny Green" @0 {}] | + | [:like "Marco Belinelli"->"Tony Parker" @0 {}] | + | [:like "Yao Ming"->"Shaquille O'Neal" @0 {}] | + | [:like "Shaquille O'Neal"->"JaVale McGee" @0 {}] | + | [:like "Tiago Splitter"->"Manu Ginobili" @0 {}] | + | [:like "Tony Parker"->"LaMarcus Aldridge" @0 {}] | + | [:like "Tony Parker"->"Manu Ginobili" @0 {}] | + | [:like "James Harden"->"Russell Westbrook" @0 {}] | + | [:like "Chris Paul"->"LeBron James" @0 {}] | + | [:like "Russell Westbrook"->"James Harden" @0 {}] | When executing query: """ - FIND SHORTEST PATH FROM "Tim Duncan" TO "Yao Ming" OVER like YIELD path as p - | UNWIND $-.p as a RETURN a + FIND SHORTEST PATH FROM "Tim Duncan" TO "Tony Parker" OVER like YIELD path as p + | YIELD nodes($-.p) AS nodes | UNWIND $-.nodes AS a | YIELD $-.a AS a """ - Then a SyntaxError should be raised at runtime: syntax error near `UNWIND' + Then the result should be, in any order, with relax comparison: + | a | + | ("Tim Duncan") | + | ("Tony Parker") | When executing query: """ GO 2 STEPS FROM "Tim Duncan" OVER * YIELD dst(edge) as id