diff --git a/src/graph/planner/SequentialPlanner.cpp b/src/graph/planner/SequentialPlanner.cpp index f7095d5fec6..08350e57d44 100644 --- a/src/graph/planner/SequentialPlanner.cpp +++ b/src/graph/planner/SequentialPlanner.cpp @@ -19,10 +19,8 @@ bool SequentialPlanner::match(AstContext* astCtx) { StatusOr SequentialPlanner::transform(AstContext* astCtx) { SubPlan subPlan; auto* seqCtx = static_cast(astCtx); - auto* qctx = seqCtx->qctx; const auto& validators = seqCtx->validators; subPlan.root = validators.back()->root(); - ifBuildDataCollect(subPlan, qctx); for (auto iter = validators.begin(); iter < validators.end() - 1; ++iter) { // Remove left tail kStart plannode before append plan. // It allows that kUse sentence to append kMatch Sentence. @@ -40,30 +38,6 @@ StatusOr SequentialPlanner::transform(AstContext* astCtx) { return subPlan; } -void SequentialPlanner::ifBuildDataCollect(SubPlan& subPlan, QueryContext* qctx) { - switch (subPlan.root->kind()) { - case PlanNode::Kind::kSort: - case PlanNode::Kind::kLimit: - case PlanNode::Kind::kSample: - case PlanNode::Kind::kDedup: - case PlanNode::Kind::kUnion: - case PlanNode::Kind::kUnionAllVersionVar: - case PlanNode::Kind::kIntersect: - case PlanNode::Kind::kCartesianProduct: - case PlanNode::Kind::kMinus: - case PlanNode::Kind::kFilter: { - auto* dc = DataCollect::make(qctx, DataCollect::DCKind::kRowBasedMove); - dc->addDep(subPlan.root); - dc->setInputVars({subPlan.root->outputVar()}); - dc->setColNames(subPlan.root->colNames()); - subPlan.root = dc; - break; - } - default: - break; - } -} - // When appending plans, it need to remove left tail plannode. // Because the left tail plannode is StartNode which needs to be removed, // and remain one size for add dependency diff --git a/src/graph/planner/SequentialPlanner.h b/src/graph/planner/SequentialPlanner.h index a37efdf7e97..769e49d8cdc 100644 --- a/src/graph/planner/SequentialPlanner.h +++ b/src/graph/planner/SequentialPlanner.h @@ -26,8 +26,6 @@ class SequentialPlanner final : public Planner { */ StatusOr transform(AstContext* astCtx) override; - void ifBuildDataCollect(SubPlan& subPlan, QueryContext* qctx); - void rmLeftTailStartNode(Validator* validator, Sentence::Kind appendPlanKind); private: diff --git a/src/graph/validator/test/FetchEdgesTest.cpp b/src/graph/validator/test/FetchEdgesTest.cpp index 4874bbc4f02..190453dd714 100644 --- a/src/graph/validator/test/FetchEdgesTest.cpp +++ b/src/graph/validator/test/FetchEdgesTest.cpp @@ -190,13 +190,7 @@ TEST_F(FetchEdgesValidatorTest, FetchEdgesProp) { auto *project = Project::make(qctx, filter, yieldColumns.get()); auto *dedup = Dedup::make(qctx, project); - // data collect - auto *dataCollect = DataCollect::make(qctx, DataCollect::DCKind::kRowBasedMove); - dataCollect->addDep(dedup); - dataCollect->setInputVars({dedup->outputVar()}); - dataCollect->setColNames({"like.start", "like.end"}); - - auto result = Eq(qctx->plan()->root(), dataCollect); + auto result = Eq(qctx->plan()->root(), dedup); ASSERT_TRUE(result.ok()) << result; } } diff --git a/src/graph/validator/test/FetchVerticesTest.cpp b/src/graph/validator/test/FetchVerticesTest.cpp index a7e62c4b24d..0f6d676b54e 100644 --- a/src/graph/validator/test/FetchVerticesTest.cpp +++ b/src/graph/validator/test/FetchVerticesTest.cpp @@ -364,13 +364,7 @@ TEST_F(FetchVerticesValidatorTest, FetchVerticesProp) { auto *dedup = Dedup::make(qctx, project); - // data collect - auto *dataCollect = DataCollect::make(qctx, DataCollect::DCKind::kRowBasedMove); - dataCollect->addDep(dedup); - dataCollect->setInputVars({dedup->outputVar()}); - dataCollect->setColNames({"person.name", "person.age"}); - - auto result = Eq(qctx->plan()->root(), dataCollect); + auto result = Eq(qctx->plan()->root(), dedup); ASSERT_TRUE(result.ok()) << result; } // ON * diff --git a/src/graph/validator/test/MatchValidatorTest.cpp b/src/graph/validator/test/MatchValidatorTest.cpp index 2356e2da7b4..e81157f7c00 100644 --- a/src/graph/validator/test/MatchValidatorTest.cpp +++ b/src/graph/validator/test/MatchValidatorTest.cpp @@ -118,8 +118,7 @@ TEST_F(MatchValidatorTest, groupby) { "avg(distinct n.person.age)+1 AS age," "labels(n) AS lb " "ORDER BY id;"; - std::vector expected = {PlanNode::Kind::kDataCollect, - PlanNode::Kind::kSort, + std::vector expected = {PlanNode::Kind::kSort, PlanNode::Kind::kProject, PlanNode::Kind::kAggregate, PlanNode::Kind::kProject, @@ -140,8 +139,7 @@ TEST_F(MatchValidatorTest, groupby) { "labels(n) AS lb " "ORDER BY id " "SKIP 10 LIMIT 20;"; - std::vector expected = {PlanNode::Kind::kDataCollect, - PlanNode::Kind::kLimit, + std::vector expected = {PlanNode::Kind::kLimit, PlanNode::Kind::kSort, PlanNode::Kind::kProject, PlanNode::Kind::kAggregate, @@ -220,8 +218,7 @@ TEST_F(MatchValidatorTest, groupby) { "avg(distinct n.person.age) AS age," "labels(m) AS lb " "SKIP 10 LIMIT 20;"; - std::vector expected = {PlanNode::Kind::kDataCollect, - PlanNode::Kind::kLimit, + std::vector expected = {PlanNode::Kind::kLimit, PlanNode::Kind::kAggregate, PlanNode::Kind::kFilter, PlanNode::Kind::kProject, @@ -242,8 +239,7 @@ TEST_F(MatchValidatorTest, groupby) { "min(n.person.age) AS min," "avg(distinct n.person.age) AS age," "labels(m) AS lb;"; - std::vector expected = {PlanNode::Kind::kDataCollect, - PlanNode::Kind::kDedup, + std::vector expected = {PlanNode::Kind::kDedup, PlanNode::Kind::kAggregate, PlanNode::Kind::kFilter, PlanNode::Kind::kProject, @@ -265,8 +261,7 @@ TEST_F(MatchValidatorTest, groupby) { "avg(distinct n.person.age)+1 AS age," "labels(m) AS lb " "SKIP 10 LIMIT 20;"; - std::vector expected = {PlanNode::Kind::kDataCollect, - PlanNode::Kind::kLimit, + std::vector expected = {PlanNode::Kind::kLimit, PlanNode::Kind::kProject, PlanNode::Kind::kAggregate, PlanNode::Kind::kFilter, @@ -290,8 +285,7 @@ TEST_F(MatchValidatorTest, groupby) { "labels(m) AS lb " "ORDER BY id " "SKIP 10 LIMIT 20;"; - std::vector expected = {PlanNode::Kind::kDataCollect, - PlanNode::Kind::kLimit, + std::vector expected = {PlanNode::Kind::kLimit, PlanNode::Kind::kSort, PlanNode::Kind::kDedup, PlanNode::Kind::kProject, @@ -317,8 +311,7 @@ TEST_F(MatchValidatorTest, groupby) { "labels(m) AS lb " "ORDER BY id " "SKIP 10 LIMIT 20;"; - std::vector expected = {PlanNode::Kind::kDataCollect, - PlanNode::Kind::kLimit, + std::vector expected = {PlanNode::Kind::kLimit, PlanNode::Kind::kSort, PlanNode::Kind::kDedup, PlanNode::Kind::kAggregate, @@ -343,8 +336,7 @@ TEST_F(MatchValidatorTest, groupby) { "labels(m) AS lb " "ORDER BY id " "SKIP 10 LIMIT 20;"; - std::vector expected = {PlanNode::Kind::kDataCollect, - PlanNode::Kind::kLimit, + std::vector expected = {PlanNode::Kind::kLimit, PlanNode::Kind::kSort, PlanNode::Kind::kDedup, PlanNode::Kind::kProject, diff --git a/src/graph/validator/test/QueryValidatorTest.cpp b/src/graph/validator/test/QueryValidatorTest.cpp index c1a1e62275e..49ea0c03d16 100644 --- a/src/graph/validator/test/QueryValidatorTest.cpp +++ b/src/graph/validator/test/QueryValidatorTest.cpp @@ -107,7 +107,6 @@ TEST_F(QueryValidatorTest, GoNSteps) { "GO 3 steps FROM \"1\",\"2\",\"3\" OVER like WHERE $^.person.age > 20" "YIELD distinct $^.person.name"; std::vector expected = { - PK::kDataCollect, PK::kDedup, PK::kProject, PK::kFilter, @@ -125,8 +124,7 @@ TEST_F(QueryValidatorTest, GoNSteps) { std::string query = "GO 2 STEPS FROM \"1\",\"2\",\"3\" OVER like WHERE $^.person.age > 20" "YIELD distinct $^.person.name "; - std::vector expected = {PK::kDataCollect, - PK::kDedup, + std::vector expected = {PK::kDedup, PK::kProject, PK::kFilter, PK::kGetNeighbors, @@ -239,8 +237,7 @@ TEST_F(QueryValidatorTest, GoWithPipe) { "GO 1 STEPS FROM \"1\" OVER like YIELD like._dst AS " "id | GO 1 STEPS FROM $-.id OVER like " "WHERE $-.id == \"2\" YIELD DISTINCT $-.id, like._dst"; - std::vector expected = {PK::kDataCollect, - PK::kDedup, + std::vector expected = {PK::kDedup, PK::kProject, PK::kFilter, PK::kInnerJoin, @@ -286,11 +283,11 @@ TEST_F(QueryValidatorTest, GoWithPipe) { "id | GO 2 STEPS FROM $-.id OVER like " "WHERE $-.id == \"2\" YIELD DISTINCT $-.id, like._dst"; std::vector expected = { - PK::kDataCollect, PK::kDedup, PK::kProject, PK::kFilter, PK::kInnerJoin, - PK::kInnerJoin, PK::kProject, PK::kGetNeighbors, PK::kLoop, PK::kDedup, - PK::kDedup, PK::kProject, PK::kProject, PK::kDedup, PK::kInnerJoin, - PK::kProject, PK::kDedup, PK::kProject, PK::kProject, PK::kGetNeighbors, - PK::kDedup, PK::kStart, PK::kProject, PK::kGetNeighbors, PK::kStart, + PK::kDedup, PK::kProject, PK::kFilter, PK::kInnerJoin, PK::kInnerJoin, + PK::kProject, PK::kGetNeighbors, PK::kLoop, PK::kDedup, PK::kDedup, + PK::kProject, PK::kProject, PK::kDedup, PK::kInnerJoin, PK::kProject, + PK::kDedup, PK::kProject, PK::kProject, PK::kGetNeighbors, PK::kDedup, + PK::kStart, PK::kProject, PK::kGetNeighbors, PK::kStart, }; EXPECT_TRUE(checkResult(query, expected)); } @@ -327,7 +324,6 @@ TEST_F(QueryValidatorTest, GoWithPipe) { "YIELD DISTINCT $-.name, like.likeness + 1, $-.id, like._dst, " "$$.person.name"; std::vector expected = { - PK::kDataCollect, PK::kDedup, PK::kProject, PK::kInnerJoin, @@ -393,13 +389,12 @@ TEST_F(QueryValidatorTest, GoWithPipe) { "YIELD DISTINCT $-.name, like.likeness + 1, $-.id, like._dst, " "$$.person.name"; std::vector expected = { - PK::kDataCollect, PK::kDedup, PK::kProject, PK::kInnerJoin, PK::kInnerJoin, - PK::kLeftJoin, PK::kProject, PK::kGetVertices, PK::kProject, PK::kGetNeighbors, - PK::kLoop, PK::kDedup, PK::kDedup, PK::kProject, PK::kProject, - PK::kDedup, PK::kInnerJoin, PK::kProject, PK::kDedup, PK::kProject, - PK::kProject, PK::kLeftJoin, PK::kDedup, PK::kProject, PK::kProject, - PK::kGetVertices, PK::kGetNeighbors, PK::kProject, PK::kStart, PK::kGetNeighbors, - PK::kStart, + PK::kDedup, PK::kProject, PK::kInnerJoin, PK::kInnerJoin, PK::kLeftJoin, + PK::kProject, PK::kGetVertices, PK::kProject, PK::kGetNeighbors, PK::kLoop, + PK::kDedup, PK::kDedup, PK::kProject, PK::kProject, PK::kDedup, + PK::kInnerJoin, PK::kProject, PK::kDedup, PK::kProject, PK::kProject, + PK::kLeftJoin, PK::kDedup, PK::kProject, PK::kProject, PK::kGetVertices, + PK::kGetNeighbors, PK::kProject, PK::kStart, PK::kGetNeighbors, PK::kStart, }; EXPECT_TRUE(checkResult(query, expected)); } @@ -603,7 +598,6 @@ TEST_F(QueryValidatorTest, GoOneStep) { "YIELD DISTINCT $^.person.name, like._dst, " "$$.person.name, $$.person.age + 1"; std::vector expected = { - PK::kDataCollect, PK::kDedup, PK::kProject, PK::kFilter, @@ -641,7 +635,6 @@ TEST_F(QueryValidatorTest, GoOneStep) { "GO FROM \"1\",\"2\",\"3\" OVER like WHERE $^.person.age > 20" "YIELD distinct $^.person.name "; std::vector expected = { - PK::kDataCollect, PK::kDedup, PK::kProject, PK::kFilter, @@ -1011,7 +1004,7 @@ TEST_F(QueryValidatorTest, Limit) { { std::string query = "GO FROM \"Ann\" OVER like YIELD like._dst AS like | LIMIT 1, 3"; std::vector expected = { - PK::kDataCollect, PK::kLimit, PK::kProject, PK::kGetNeighbors, PK::kStart}; + PK::kLimit, PK::kProject, PK::kGetNeighbors, PK::kStart}; EXPECT_TRUE(checkResult(query, expected)); } } @@ -1021,8 +1014,7 @@ TEST_F(QueryValidatorTest, OrderBy) { std::string query = "GO FROM \"Ann\" OVER like YIELD $^.person.age AS age" " | ORDER BY $-.age"; - std::vector expected = { - PK::kDataCollect, PK::kSort, PK::kProject, PK::kGetNeighbors, PK::kStart}; + std::vector expected = {PK::kSort, PK::kProject, PK::kGetNeighbors, PK::kStart}; EXPECT_TRUE(checkResult(query, expected)); } // not exist factor @@ -1040,7 +1032,7 @@ TEST_F(QueryValidatorTest, OrderByAndLimit) { "GO FROM \"Ann\" OVER like YIELD $^.person.age AS age" " | ORDER BY $-.age | LIMIT 1"; std::vector expected = { - PK::kDataCollect, PK::kLimit, PK::kSort, PK::kProject, PK::kGetNeighbors, PK::kStart}; + PK::kLimit, PK::kSort, PK::kProject, PK::kGetNeighbors, PK::kStart}; EXPECT_TRUE(checkResult(query, expected)); } } @@ -1053,7 +1045,6 @@ TEST_F(QueryValidatorTest, TestSetValidator) { "\"2\" " "OVER like YIELD like.start AS start"; std::vector expected = { - PK::kDataCollect, PK::kUnion, PK::kProject, PK::kProject, @@ -1072,7 +1063,6 @@ TEST_F(QueryValidatorTest, TestSetValidator) { "YIELD " "like.start AS start"; std::vector expected = { - PK::kDataCollect, PK::kDedup, PK::kUnion, PK::kDedup, @@ -1096,7 +1086,6 @@ TEST_F(QueryValidatorTest, TestSetValidator) { "FROM \"2\" " "OVER like YIELD like.start AS start"; std::vector expected = { - PK::kDataCollect, PK::kDedup, PK::kUnion, PK::kProject, @@ -1121,7 +1110,6 @@ TEST_F(QueryValidatorTest, TestSetValidator) { "GO FROM \"1\" OVER like YIELD like.start AS start INTERSECT GO FROM " "\"2\" OVER like YIELD like.start AS start"; std::vector expected = { - PK::kDataCollect, PK::kIntersect, PK::kProject, PK::kProject, @@ -1138,7 +1126,6 @@ TEST_F(QueryValidatorTest, TestSetValidator) { "GO FROM \"1\" OVER like YIELD like.start AS start MINUS GO FROM " "\"2\" OVER like YIELD like.start AS start"; std::vector expected = { - PK::kDataCollect, PK::kMinus, PK::kProject, PK::kProject, @@ -1209,7 +1196,6 @@ TEST_F(QueryValidatorTest, TestMatch) { "MATCH (:person{name:'Dwyane Wade'}) -[:like]-> () -[:like]-> (v3) " "RETURN DISTINCT v3.person.name AS Name"; std::vector expected = { - PK::kDataCollect, PK::kDedup, PK::kProject, PK::kProject, diff --git a/src/graph/validator/test/YieldValidatorTest.cpp b/src/graph/validator/test/YieldValidatorTest.cpp index b436933ff14..fa4d47ef13e 100644 --- a/src/graph/validator/test/YieldValidatorTest.cpp +++ b/src/graph/validator/test/YieldValidatorTest.cpp @@ -523,7 +523,6 @@ TEST_F(YieldValidatorTest, AggCall) { "like.likeness AS like" "| YIELD DISTINCT AVG($-.age + 1), SUM($-.like), COUNT(*)"; expected_ = { - PlanNode::Kind::kDataCollect, PlanNode::Kind::kDedup, PlanNode::Kind::kAggregate, PlanNode::Kind::kProject, diff --git a/tests/tck/features/lookup/LookUpLimit.feature b/tests/tck/features/lookup/LookUpLimit.feature index d66456c4408..684a5979bd7 100644 --- a/tests/tck/features/lookup/LookUpLimit.feature +++ b/tests/tck/features/lookup/LookUpLimit.feature @@ -17,7 +17,6 @@ Feature: Push Limit down IndexScan Rule | /[a-zA-Z ']+/ | And the execution plan should be: | id | name | dependencies | operator info | - | 4 | DataCollect | 5 | | | 5 | Sort | 6 | | | 6 | Project | 7 | | | 7 | Limit | 8 | {"count": "2"} | @@ -33,7 +32,6 @@ Feature: Push Limit down IndexScan Rule | /[a-zA-Z ']+/ | /[a-zA-Z ']+/ | /\d+/ | And the execution plan should be: | id | name | dependencies | operator info | - | 4 | DataCollect | 5 | | | 5 | Sort | 6 | | | 6 | Project | 7 | | | 7 | Limit | 8 | {"count": "2"} | @@ -49,7 +47,6 @@ Feature: Push Limit down IndexScan Rule | /[a-zA-Z ']+/ | And the execution plan should be: | id | name | dependencies | operator info | - | 4 | DataCollect | 5 | | | 5 | Sort | 6 | | | 6 | Project | 7 | | | 7 | Limit | 8 | {"count": "2"} | @@ -65,7 +62,6 @@ Feature: Push Limit down IndexScan Rule | /[a-zA-Z ']+/ | /[a-zA-Z ']+/ | /\d+/ | And the execution plan should be: | id | name | dependencies | operator info | - | 4 | DataCollect | 5 | | | 5 | Sort | 6 | | | 6 | Project | 7 | | | 7 | Limit | 8 | {"count": "2"} | @@ -84,7 +80,6 @@ Feature: Push Limit down IndexScan Rule | /[a-zA-Z ']+/ | And the execution plan should be: | id | name | dependencies | operator info | - | 3 | DataCollect | 4 | | | 4 | Sort | 5 | | | 5 | Project | 7 | | | 7 | Limit | 8 | | @@ -101,7 +96,6 @@ Feature: Push Limit down IndexScan Rule | /[a-zA-Z ']+/ | /[a-zA-Z ']+/ | /\d+/ | And the execution plan should be: | id | name | dependencies | operator info | - | 3 | DataCollect | 4 | | | 4 | Sort | 5 | | | 5 | Project | 7 | | | 7 | Limit | 8 | | @@ -118,7 +112,6 @@ Feature: Push Limit down IndexScan Rule | /[a-zA-Z ']+/ | And the execution plan should be: | id | name | dependencies | operator info | - | 3 | DataCollect | 4 | | | 4 | Sort | 5 | | | 5 | Project | 7 | | | 7 | Limit | 8 | | @@ -135,7 +128,6 @@ Feature: Push Limit down IndexScan Rule | /[a-zA-Z ']+/ | /[a-zA-Z ']+/ | /\d+/ | And the execution plan should be: | id | name | dependencies | operator info | - | 3 | DataCollect | 4 | | | 4 | Sort | 5 | | | 5 | Project | 7 | | | 7 | Limit | 8 | | diff --git a/tests/tck/features/lookup/LookUpTopN.feature b/tests/tck/features/lookup/LookUpTopN.feature index c5aabc4463f..0f4ee041546 100644 --- a/tests/tck/features/lookup/LookUpTopN.feature +++ b/tests/tck/features/lookup/LookUpTopN.feature @@ -17,14 +17,12 @@ Feature: Push TopN down IndexScan Rule | "Aron Baynes" | And the execution plan should be: | id | name | dependencies | operator info | - | 4 | DataCollect | 5 | | | 5 | TopN | 6 | {"count": "2"} | | 6 | Project | 7 | | | 7 | TagIndexFullScan | 0 | {"limit": "9223372036854775807" } | | 0 | Start | | | And the execution plan should be: | id | name | dependencies | operator info | - | 4 | DataCollect | 5 | | | 5 | TopN | 6 | | | 6 | Project | 7 | | | 7 | TagIndexFullScan | 0 | {"orderBy": "[]"} | @@ -39,14 +37,12 @@ Feature: Push TopN down IndexScan Rule | "DeAndre Jordan" | And the execution plan should be: | id | name | dependencies | operator info | - | 4 | DataCollect | 5 | | | 5 | TopN | 6 | {"count": "2"} | | 6 | Project | 7 | | | 7 | TagIndexPrefixScan | 0 | {"limit": "9223372036854775807" } | | 0 | Start | | | And the execution plan should be: | id | name | dependencies | operator info | - | 4 | DataCollect | 5 | | | 5 | TopN | 6 | | | 6 | Project | 7 | | | 7 | TagIndexPrefixScan | 0 | {"orderBy": "[]"} | @@ -61,14 +57,12 @@ Feature: Push TopN down IndexScan Rule | "Tim Duncan" | And the execution plan should be: | id | name | dependencies | operator info | - | 4 | DataCollect | 5 | | | 5 | TopN | 6 | {"count": "2"} | | 6 | Project | 7 | | | 7 | TagIndexRangeScan | 0 | {"limit": "9223372036854775807" } | | 0 | Start | | | And the execution plan should be: | id | name | dependencies | operator info | - | 4 | DataCollect | 5 | | | 5 | TopN | 6 | | | 6 | Project | 7 | | | 7 | TagIndexRangeScan | 0 | {"orderBy": "[]"} | @@ -83,14 +77,12 @@ Feature: Push TopN down IndexScan Rule | "Aron Baynes" | And the execution plan should be: | id | name | dependencies | operator info | - | 4 | DataCollect | 5 | | | 5 | TopN | 6 | {"count": "2"} | | 6 | Project | 7 | | | 7 | TagIndexFullScan | 0 | {"limit": "9223372036854775807" } | | 0 | Start | | | And the execution plan should be: | id | name | dependencies | operator info | - | 4 | DataCollect | 5 | | | 5 | TopN | 6 | | | 6 | Project | 7 | | | 7 | TagIndexFullScan | 0 | {"orderBy": "[]"} | @@ -105,14 +97,12 @@ Feature: Push TopN down IndexScan Rule | "Aron Baynes" | "Tim Duncan" | 0 | And the execution plan should be: | id | name | dependencies | operator info | - | 4 | DataCollect | 5 | | | 5 | TopN | 6 | {"count": "2"} | | 6 | Project | 7 | | | 7 | EdgeIndexFullScan | 0 | {"limit": "9223372036854775807" } | | 0 | Start | | | And the execution plan should be: | id | name | dependencies | operator info | - | 4 | DataCollect | 5 | | | 5 | TopN | 6 | | | 6 | Project | 7 | | | 7 | EdgeIndexFullScan | 0 | {"orderBy": "[]"} | @@ -127,14 +117,12 @@ Feature: Push TopN down IndexScan Rule | "Carmelo Anthony" | "Chris Paul" | 0 | And the execution plan should be: | id | name | dependencies | operator info | - | 4 | DataCollect | 5 | | | 5 | TopN | 6 | {"count": "2"} | | 6 | Project | 7 | | | 7 | EdgeIndexPrefixScan | 0 | {"limit": "9223372036854775807" } | | 0 | Start | | | And the execution plan should be: | id | name | dependencies | operator info | - | 4 | DataCollect | 5 | | | 5 | TopN | 6 | | | 6 | Project | 7 | | | 7 | EdgeIndexPrefixScan | 0 | {"orderBy": "[]"} | @@ -149,14 +137,12 @@ Feature: Push TopN down IndexScan Rule | "Dejounte Murray" | "Chris Paul" | 0 | And the execution plan should be: | id | name | dependencies | operator info | - | 4 | DataCollect | 5 | | | 5 | TopN | 6 | {"count": "2"} | | 6 | Project | 7 | | | 7 | EdgeIndexRangeScan | 0 | {"limit": "9223372036854775807" } | | 0 | Start | | | And the execution plan should be: | id | name | dependencies | operator info | - | 4 | DataCollect | 5 | | | 5 | TopN | 6 | | | 6 | Project | 7 | | | 7 | EdgeIndexRangeScan | 0 | {"orderBy": "[]"} | @@ -173,7 +159,6 @@ Feature: Push TopN down IndexScan Rule | "Aron Baynes" | And the execution plan should be: | id | name | dependencies | operator info | - | 4 | DataCollect | 5 | | | 5 | TopN | 6 | {"count": "2"} | | 6 | Project | 7 | | | 7 | TagIndexFullScan | 0 | {"limit": "2" } | @@ -188,7 +173,6 @@ Feature: Push TopN down IndexScan Rule | "Kevin Durant" | And the execution plan should be: | id | name | dependencies | operator info | - | 4 | DataCollect | 5 | | | 5 | TopN | 6 | {"count": "2"} | | 6 | Project | 7 | | | 7 | TagIndexPrefixScan | 0 | {"limit": "2" } | @@ -203,7 +187,6 @@ Feature: Push TopN down IndexScan Rule | "DeAndre Jordan" | And the execution plan should be: | id | name | dependencies | operator info | - | 4 | DataCollect | 5 | | | 5 | TopN | 6 | {"count": "2"} | | 6 | Project | 7 | | | 7 | TagIndexPrefixScan | 0 | {"limit": "2" } | @@ -218,7 +201,6 @@ Feature: Push TopN down IndexScan Rule | "Tim Duncan" | And the execution plan should be: | id | name | dependencies | operator info | - | 4 | DataCollect | 5 | | | 5 | TopN | 6 | {"count": "2"} | | 6 | Project | 7 | | | 7 | TagIndexRangeScan | 0 | {"limit": "2" } | @@ -233,7 +215,6 @@ Feature: Push TopN down IndexScan Rule | -1 | And the execution plan should be: | id | name | dependencies | operator info | - | 4 | DataCollect | 5 | | | 5 | TopN | 6 | {"count": "2"} | | 6 | Project | 7 | | | 7 | EdgeIndexFullScan | 0 | {"limit": "2" } | @@ -248,7 +229,6 @@ Feature: Push TopN down IndexScan Rule | 100 | And the execution plan should be: | id | name | dependencies | operator info | - | 4 | DataCollect | 5 | | | 5 | TopN | 6 | {"count": "2"} | | 6 | Project | 7 | | | 7 | EdgeIndexFullScan | 0 | {"limit": "2" } | @@ -263,7 +243,6 @@ Feature: Push TopN down IndexScan Rule | 90 | And the execution plan should be: | id | name | dependencies | operator info | - | 4 | DataCollect | 5 | | | 5 | TopN | 6 | {"count": "2"} | | 6 | Project | 7 | | | 7 | EdgeIndexPrefixScan | 0 | {"limit": "2" } | @@ -278,7 +257,6 @@ Feature: Push TopN down IndexScan Rule | 95 | And the execution plan should be: | id | name | dependencies | operator info | - | 4 | DataCollect | 5 | | | 5 | TopN | 6 | {"count": "2"} | | 6 | Project | 7 | | | 7 | EdgeIndexRangeScan | 0 | {"limit": "2" } | diff --git a/tests/tck/features/optimizer/CollapseProjectRule.feature b/tests/tck/features/optimizer/CollapseProjectRule.feature index 1e52fcabfa0..924b61635ba 100644 --- a/tests/tck/features/optimizer/CollapseProjectRule.feature +++ b/tests/tck/features/optimizer/CollapseProjectRule.feature @@ -95,7 +95,6 @@ Feature: Collapse Project Rule | 29 | "Dejounte Murray" | And the execution plan should be: | id | name | dependencies | operator info | - | 11 | DataCollect | 10 | | | 10 | Dedup | 14 | | | 14 | Project | 12 | | | 12 | Filter | 6 | | diff --git a/tests/tck/features/optimizer/PrunePropertiesRule.feature b/tests/tck/features/optimizer/PrunePropertiesRule.feature index 795c9d0daa3..47941a96355 100644 --- a/tests/tck/features/optimizer/PrunePropertiesRule.feature +++ b/tests/tck/features/optimizer/PrunePropertiesRule.feature @@ -170,6 +170,7 @@ Feature: Prune Properties rule | "Tim Duncan" | "Boris Diaw" | "Suns" | | "Tim Duncan" | "Boris Diaw" | "Tim Duncan" | And the execution plan should be: +<<<<<<< HEAD | id | name | dependencies | operator info | | 16 | TopN | 12 | | | 12 | Project | 9 | | @@ -184,6 +185,22 @@ Feature: Prune Properties rule | 8 | AppendVertices | 7 | { "props": "[{\"tagId\":9,\"props\":[\"name\"]}, {\"tagId\":10,\"props\":[\"name\"]}]" } | | 7 | Traverse | 6 | { "vertexProps": "[{\"tagId\":9,\"props\":[\"name\"]}]", "edgeProps": "[{\"type\": -5, \"props\": [\"_dst\", \"_rank\", \"_type\"]}, {\"type\": 5, \"props\": [\"_dst\", \"_rank\", \"_type\"]}, {\"props\": [\"_dst\", \"_rank\", \"_type\"], \"type\": -3}, {\"props\": [\"_dst\", \"_rank\", \"_type\"], \"type\": 3}, {\"type\": -4, \"props\": [\"_dst\", \"_rank\", \"_type\"]}, {\"props\": [\"_dst\", \"_rank\", \"_type\"], \"type\": 4}]" } | | 6 | Argument | | | +======= + | id | name | dependencies | operator info | + | 16 | TopN | 12 | | + | 12 | Project | 9 | | + | 9 | BiInnerJoin | 22, 23 | | + | 22 | Project | 5 | | + | 5 | AppendVertices | 4 | { "props": "[{\"props\":[\"name\"],\"tagId\":9}]" } | + | 4 | Traverse | 2 | { "vertexProps": "[{\"props\":[\"name\"],\"tagId\":9}]" } | + | 2 | Dedup | 1 | | + | 1 | PassThrough | 3 | | + | 3 | Start | | | + | 23 | Project | 8 | | + | 8 | AppendVertices | 7 | { "props": "[{\"tagId\":9,\"props\":[\"name\"]}, {\"tagId\":10,\"props\":[\"name\"]}]" } | + | 7 | Traverse | 6 | { "vertexProps": "[{\"tagId\":9,\"props\":[\"name\"]}]", "edgeProps": "[{\"type\": -5, \"props\": [\"_dst\", \"_rank\", \"_type\", \"_src\"]}, {\"type\": 5, \"props\": [\"_dst\", \"_rank\", \"_type\", \"_src\"]}, {\"props\": [\"_dst\", \"_rank\", \"_type\", \"_src\"], \"type\": -3}, {\"props\": [\"_dst\", \"_rank\", \"_type\", \"_src\"], \"type\": 3}, {\"type\": -4, \"props\": [\"_dst\", \"_rank\", \"_type\", \"_src\"]}, {\"props\": [\"_dst\", \"_rank\", \"_type\", \"_src\"], \"type\": 4}]" } | + | 6 | Argument | | | +>>>>>>> 63179178d (remove useless dc (#4533)) When profiling query: """ MATCH (m)-[]-(n), (n)-[]-(l), (l)-[]-(h) WHERE id(m)=="Tim Duncan" @@ -203,6 +220,7 @@ Feature: Prune Properties rule | "Tim Duncan" | "Aron Baynes" | "Spurs" | "Aron Baynes" | | "Tim Duncan" | "Aron Baynes" | "Spurs" | "Boris Diaw" | And the execution plan should be: +<<<<<<< HEAD | id | name | dependencies | operator info | | 20 | TopN | 23 | | | 23 | Project | 13 | | @@ -223,6 +241,28 @@ Feature: Prune Properties rule | 12 | AppendVertices | 11 | { "props": "[{\"props\":[\"name\"],\"tagId\":9}]" } | | 11 | Traverse | 10 | { "vertexProps": "[{\"props\":[\"name\"],\"tagId\":10}]", "edgeProps": "[{\"type\": -5, \"props\": [\"_dst\", \"_rank\", \"_type\"]}, {\"type\": 5, \"props\": [\"_dst\", \"_rank\", \"_type\"]}, {\"props\": [\"_dst\", \"_rank\", \"_type\"], \"type\": -3}, {\"props\": [\"_dst\", \"_rank\", \"_type\"], \"type\": 3}, {\"type\": -4, \"props\": [\"_dst\", \"_rank\", \"_type\"]}, {\"props\": [\"_dst\", \"_rank\", \"_type\"], \"type\": 4}]" } | | 10 | Argument | | | +======= + | id | name | dependencies | operator info | + | 20 | TopN | 23 | | + | 23 | Project | 13 | | + | 13 | BiInnerJoin | 9, 30 | | + | 9 | BiInnerJoin | 28, 29 | | + | 28 | Project | 5 | | + | 5 | AppendVertices | 4 | { "props": "[{\"props\":[\"name\"],\"tagId\":9}]" } | + | 4 | Traverse | 2 | { "vertexProps": "[{\"props\":[\"name\"],\"tagId\":9}]", "edgeProps": "[{\"type\": -5, \"props\": [\"_dst\", \"_rank\", \"_type\", \"_src\"]}, {\"type\": 5, \"props\": [\"_dst\", \"_rank\", \"_type\", \"_src\"]}, {\"props\": [\"_dst\", \"_rank\", \"_type\", \"_src\"], \"type\": -3}, {\"props\": [\"_dst\", \"_rank\", \"_type\", \"_src\"], \"type\": 3}, {\"type\": -4, \"props\": [\"_dst\", \"_rank\", \"_type\", \"_src\"]}, {\"props\": [\"_dst\", \"_rank\", \"_type\", \"_src\"], \"type\": 4}]" } | + | 2 | Dedup | 1 | | + | 1 | PassThrough | 3 | | + | 3 | Start | | | + | 29 | Project | 8 | | + | 8 | AppendVertices | 7 | { "props": "[{\"tagId\":10,\"props\":[\"name\"]}]" } | + | 7 | Traverse | 6 | { "vertexProps": "[{\"tagId\":9,\"props\":[\"name\"]}]", "edgeProps": "[{\"type\": -5, \"props\": [\"_dst\", \"_rank\", \"_type\", \"_src\"]}, {\"type\": 5, \"props\": [\"_dst\", \"_rank\", \"_type\", \"_src\"]}, {\"props\": [\"_dst\", \"_rank\", \"_type\", \"_src\"], \"type\": -3}, {\"props\": [\"_dst\", \"_rank\", \"_type\", \"_src\"], \"type\": 3}, {\"type\": -4, \"props\": [\"_dst\", \"_rank\", \"_type\", \"_src\"]}, {\"props\": [\"_dst\", \"_rank\", \"_type\", \"_src\"], \"type\": 4}]" } | + | 6 | Argument | | | + | 31 | Start | | | + | 30 | Project | 12 | | + | 12 | AppendVertices | 11 | { "props": "[{\"props\":[\"name\"],\"tagId\":9}]" } | + | 11 | Traverse | 10 | { "vertexProps": "[{\"props\":[\"name\"],\"tagId\":10}]", "edgeProps": "[{\"type\": -5, \"props\": [\"_dst\", \"_rank\", \"_type\", \"_src\"]}, {\"type\": 5, \"props\": [\"_dst\", \"_rank\", \"_type\", \"_src\"]}, {\"props\": [\"_dst\", \"_rank\", \"_type\", \"_src\"], \"type\": -3}, {\"props\": [\"_dst\", \"_rank\", \"_type\", \"_src\"], \"type\": 3}, {\"type\": -4, \"props\": [\"_dst\", \"_rank\", \"_type\", \"_src\"]}, {\"props\": [\"_dst\", \"_rank\", \"_type\", \"_src\"], \"type\": 4}]" } | + | 10 | Argument | | | +>>>>>>> 63179178d (remove useless dc (#4533)) # The schema id is not fixed in standalone cluster, so we skip it @distonly @@ -250,7 +290,6 @@ Feature: Prune Properties rule | "Tim Duncan" | "Boris Diaw" | "Tim Duncan" | And the execution plan should be: | id | name | dependencies | operator info | - | 16 | DataCollect | 17 | | | 17 | TopN | 13 | | | 13 | Project | 12 | | | 12 | BiInnerJoin | 19, 11 | | @@ -285,6 +324,7 @@ Feature: Prune Properties rule | "Tim Duncan" | "Aron Baynes" | "Spurs" | "Aron Baynes" | | "Tim Duncan" | "Aron Baynes" | "Spurs" | "Boris Diaw" | And the execution plan should be: +<<<<<<< HEAD | id | name | dependencies | operator info | | 21 | TopN | 17 | | | 17 | Project | 16 | | @@ -306,6 +346,29 @@ Feature: Prune Properties rule | 12 | Traverse | 11 | { "vertexProps": "[{\"tagId\":10,\"props\":[\"name\"]}]", "edgeProps": "[{\"props\": [\"_dst\", \"_rank\", \"_type\"], \"type\": -5}, {\"props\": [\"_dst\", \"_rank\", \"_type\"], \"type\": 5}, {\"type\": -3, \"props\": [\"_dst\", \"_rank\", \"_type\"]}, {\"props\": [\"_dst\", \"_rank\", \"_type\"], \"type\": 3}, {\"props\": [\"_dst\", \"_rank\", \"_type\"], \"type\": -4}, {\"props\": [\"_dst\", \"_rank\", \"_type\"], \"type\": 4}]" } | | 11 | Argument | | | | 36 | Start | | | +======= + | id | name | dependencies | operator info | + | 21 | TopN | 17 | | + | 17 | Project | 16 | | + | 16 | BiInnerJoin | 23, 14 | | + | 23 | Project | 5 | | + | 5 | AppendVertices | 4 | { "props": "[{\"props\":[\"name\"],\"tagId\":9}]" } | + | 4 | Traverse | 2 | { "vertexProps": "[{\"props\":[\"name\"],\"tagId\":9}]" } | + | 2 | Dedup | 1 | | + | 1 | PassThrough | 3 | | + | 3 | Start | | | + | 14 | BiInnerJoin | 33, 34 | | + | 33 | Project | 10 | | + | 10 | AppendVertices | 9 | { "props": "[{\"tagId\":10,\"props\":[\"name\"]}]" } | + | 9 | Traverse | 8 | { "vertexProps": "[{\"tagId\":9,\"props\":[\"name\"]}]" } | + | 8 | Argument | | | + | 35 | Start | | | + | 34 | Project | 13 | | + | 13 | AppendVertices | 12 | { "props": "[{\"tagId\":9,\"props\":[\"name\"]}]" } | + | 12 | Traverse | 11 | { "vertexProps": "[{\"tagId\":10,\"props\":[\"name\"]}]", "edgeProps": "[{\"props\": [\"_dst\", \"_rank\", \"_type\", \"_src\"], \"type\": -5}, {\"props\": [\"_dst\", \"_rank\", \"_type\", \"_src\"], \"type\": 5}, {\"type\": -3, \"props\": [\"_dst\", \"_rank\", \"_type\", \"_src\"]}, {\"props\": [\"_dst\", \"_rank\", \"_type\", \"_src\"], \"type\": 3}, {\"props\": [\"_dst\", \"_rank\", \"_type\", \"_src\"], \"type\": -4}, {\"props\": [\"_dst\", \"_rank\", \"_type\", \"_src\"], \"type\": 4}]" } | + | 11 | Argument | | | + | 36 | Start | | | +>>>>>>> 63179178d (remove useless dc (#4533)) When profiling query: """ MATCH (v:player{name:"Tony Parker"}) @@ -354,7 +417,6 @@ Feature: Prune Properties rule | "Tim Duncan" | "Manu Ginobili" | NULL | And the execution plan should be: | id | name | dependencies | operator info | - | 16 | DataCollect | 17 | | | 17 | TopN | 13 | | | 13 | Project | 12 | | | 12 | BiLeftJoin | 19, 11 | | diff --git a/tests/tck/features/optimizer/PushFilterDownAggregateRule.feature b/tests/tck/features/optimizer/PushFilterDownAggregateRule.feature index 44d5c5fbfca..8d1b0a78784 100644 --- a/tests/tck/features/optimizer/PushFilterDownAggregateRule.feature +++ b/tests/tck/features/optimizer/PushFilterDownAggregateRule.feature @@ -36,7 +36,6 @@ Feature: Push Filter down Aggregate rule | 29 | 3 | And the execution plan should be: | id | name | dependencies | operator info | - | 13 | DataCollect | 12 | | | 12 | Sort | 19 | | | 19 | Aggregate | 18 | | | 18 | Filter | 8 | | diff --git a/tests/tck/features/optimizer/PushFilterDownProjectRule.feature b/tests/tck/features/optimizer/PushFilterDownProjectRule.feature index b1e6e7df325..818dceb53f6 100644 --- a/tests/tck/features/optimizer/PushFilterDownProjectRule.feature +++ b/tests/tck/features/optimizer/PushFilterDownProjectRule.feature @@ -61,7 +61,6 @@ Feature: Push Filter down Project rule | ("Tim Duncan" :bachelor{name: "Tim Duncan", speciality: "psychology"} :player{age: 42, name: "Tim Duncan"}) | ("Manu Ginobili" :player{age: 41, name: "Manu Ginobili"}) | 30 | And the execution plan should be: | id | name | dependencies | operator info | - | 25 | DataCollect | 24 | | | 24 | Dedup | 41 | | | 41 | Project | 40 | | | 40 | Filter | 20 | | diff --git a/tests/tck/features/optimizer/RemoveUselessProjectRule.feature b/tests/tck/features/optimizer/RemoveUselessProjectRule.feature index 7fda5985b8e..8d0da733d09 100644 --- a/tests/tck/features/optimizer/RemoveUselessProjectRule.feature +++ b/tests/tck/features/optimizer/RemoveUselessProjectRule.feature @@ -50,7 +50,6 @@ Feature: Remove Useless Project Rule | 48 | 1 | And the execution plan should be: | id | name | dependencies | operator info | - | 7 | DataCollect | 6 | | | 6 | Sort | 8 | | | 8 | Aggregate | 2 | | | 2 | AppendVertices | 1 | | diff --git a/tests/tck/features/optimizer/TopNRule.feature b/tests/tck/features/optimizer/TopNRule.feature index a4414d61f66..547a3ae637f 100644 --- a/tests/tck/features/optimizer/TopNRule.feature +++ b/tests/tck/features/optimizer/TopNRule.feature @@ -20,7 +20,6 @@ Feature: TopN rule | 55 | And the execution plan should be: | id | name | dependencies | operator info | - | 0 | DataCollect | 1 | | | 1 | TopN | 2 | | | 2 | Project | 3 | | | 3 | GetNeighbors | 4 | | @@ -39,7 +38,6 @@ Feature: TopN rule | 83 | And the execution plan should be: | id | name | dependencies | operator info | - | 0 | DataCollect | 1 | | | 1 | TopN | 2 | | | 2 | Project | 3 | | | 3 | GetNeighbors | 4 | | @@ -58,7 +56,6 @@ Feature: TopN rule | 60 | And the execution plan should be: | id | name | dependencies | operator info | - | 0 | DataCollect | 1 | | | 1 | Limit | 2 | | | 2 | Sort | 3 | | | 3 | Project | 4 | | @@ -79,7 +76,6 @@ Feature: TopN rule | 60 | And the execution plan should be: | id | name | dependencies | operator info | - | 0 | DataCollect | 1 | | | 1 | Sort | 2 | | | 2 | Project | 3 | | | 3 | GetNeighbors | 4 | |