From dcb0ab176ec17e960a0ef04bd7f42c5975c0a897 Mon Sep 17 00:00:00 2001 From: jievince <38901892+jievince@users.noreply.github.com> Date: Thu, 10 Feb 2022 18:20:20 +0800 Subject: [PATCH] remove unused code --- src/common/expression/Expression.h | 1 - src/graph/optimizer/Optimizer.h | 2 - src/graph/util/ExpressionUtils.h | 2 - .../features/match/MultiQueryParts.feature | 169 ++---------------- .../tck/features/yield/NoSpaceChosen.feature | 1 - 5 files changed, 17 insertions(+), 158 deletions(-) diff --git a/src/common/expression/Expression.h b/src/common/expression/Expression.h index 23dd93ffe29..96bb68451d0 100644 --- a/src/common/expression/Expression.h +++ b/src/common/expression/Expression.h @@ -8,7 +8,6 @@ #include "common/base/Base.h" #include "common/base/ObjectPool.h" -#include "common/base/Status.h" #include "common/context/ExpressionContext.h" #include "common/datatypes/Value.h" diff --git a/src/graph/optimizer/Optimizer.h b/src/graph/optimizer/Optimizer.h index 46ba4006079..b09a48ef4a8 100644 --- a/src/graph/optimizer/Optimizer.h +++ b/src/graph/optimizer/Optimizer.h @@ -33,8 +33,6 @@ class Optimizer final { StatusOr findBestPlan(graph::QueryContext *qctx); private: - Status preprocess(graph::PlanNode *root, graph::QueryContext *qctx, GraphSpaceID spaceID); - Status postprocess(graph::PlanNode *root, graph::QueryContext *qctx, GraphSpaceID spaceID); StatusOr prepare(OptContext *ctx, graph::PlanNode *root); diff --git a/src/graph/util/ExpressionUtils.h b/src/graph/util/ExpressionUtils.h index ceba8e99633..b5d3f642fc3 100644 --- a/src/graph/util/ExpressionUtils.h +++ b/src/graph/util/ExpressionUtils.h @@ -169,8 +169,6 @@ class ExpressionUtils { static bool isGeoIndexAcceleratedPredicate(const Expression* expr); static bool checkExprDepth(const Expression* expr); - - static constexpr int32_t kMaxDepth = 512; }; } // namespace graph diff --git a/tests/tck/features/match/MultiQueryParts.feature b/tests/tck/features/match/MultiQueryParts.feature index 10654ce2c05..2a5cda28864 100644 --- a/tests/tck/features/match/MultiQueryParts.feature +++ b/tests/tck/features/match/MultiQueryParts.feature @@ -7,7 +7,7 @@ Feature: Multi Query Parts Given a graph with space named "nba" Scenario: Multi Path Patterns - When profiling query: + When executing query: """ MATCH (m)-[]-(n), (n)-[]-(l) WHERE id(m)=="Tim Duncan" RETURN m.player.name AS n1, n.player.name AS n2, @@ -26,42 +26,7 @@ Feature: Multi Query Parts | "Tim Duncan" | "Boris Diaw" | "Spurs" | | "Tim Duncan" | "Boris Diaw" | "Suns" | | "Tim Duncan" | "Boris Diaw" | "Tim Duncan" | - # And the execution plan should be: - # | id | name | dependencies | operator info | - # | 15 | DataCollect | 16 | | - # | 16 | TopN | 12 | | - # | 12 | Project | 18 | | - # | 18 | Project | 17 | | - # | 17 | Filter | 9 | | - # | 9 | BiInnerJoin | 5, 8 | | - # | 5 | AppendVertices | 4 | { "props": "[{\"props\":[\"name\"],\"tagId\":2}]" } | - # | 4 | Traverse | 2 | { "vertexProps": "[{\"props\":[\"name\"],\"tagId\":2}]" } | - # | 2 | Dedup | 1 | | - # | 1 | PassThrough | 3 | | - # | 3 | Start | | | - # | 8 | AppendVertices | 7 | { "props": "[{\"tagId\":2,\"props\":[\"name\"]}, {\"tagId\":3,\"props\":[\"name\"]}]" } | - # | 7 | Traverse | 6 | { "vertexProps": "[{\"tagId\":2,\"props\":[\"name\"]}]" } | - # | 6 | Argument | | | - When profiling query: - """ - MATCH (m)-[]-(n), (l)-[]-(n) WHERE id(m)=="Tim Duncan" - RETURN m.player.name AS n1, n.player.name AS n2, - CASE WHEN l.team.name is not null THEN l.team.name - WHEN l.player.name is not null THEN l.player.name ELSE "null" END AS n3 ORDER BY n1, n2, n3 LIMIT 10 - """ - Then the result should be, in order: - | n1 | n2 | n3 | - | "Tim Duncan" | "Aron Baynes" | "Celtics" | - | "Tim Duncan" | "Aron Baynes" | "Pistons" | - | "Tim Duncan" | "Aron Baynes" | "Spurs" | - | "Tim Duncan" | "Aron Baynes" | "Tim Duncan" | - | "Tim Duncan" | "Boris Diaw" | "Hawks" | - | "Tim Duncan" | "Boris Diaw" | "Hornets" | - | "Tim Duncan" | "Boris Diaw" | "Jazz" | - | "Tim Duncan" | "Boris Diaw" | "Spurs" | - | "Tim Duncan" | "Boris Diaw" | "Suns" | - | "Tim Duncan" | "Boris Diaw" | "Tim Duncan" | - When profiling query: + When executing query: """ MATCH (m)-[]-(n), (n)-[]-(l) WHERE id(n)=="Tim Duncan" RETURN m.player.name AS n1, n.player.name AS n2, l.player.name AS n3 ORDER BY n1, n2, n3 LIMIT 10 @@ -78,7 +43,7 @@ Feature: Multi Query Parts | "Aron Baynes" | "Tim Duncan" | "Manu Ginobili" | | "Aron Baynes" | "Tim Duncan" | "Manu Ginobili" | | "Aron Baynes" | "Tim Duncan" | "Manu Ginobili" | - When profiling query: + When executing query: """ MATCH (m)-[]-(n), (n)-[]-(l), (l)-[]-(h) WHERE id(m)=="Tim Duncan" RETURN m.player.name AS n1, n.player.name AS n2, l.team.name AS n3, h.player.name AS n4 @@ -96,26 +61,7 @@ Feature: Multi Query Parts | "Tim Duncan" | "Aron Baynes" | "Pistons" | "Grant Hill" | | "Tim Duncan" | "Aron Baynes" | "Spurs" | "Aron Baynes" | | "Tim Duncan" | "Aron Baynes" | "Spurs" | "Boris Diaw" | - # And the execution plan should be: - # | id | name | dependencies | operator info | - # | 19 | DataCollect | 20 | | - # | 20 | TopN | 23 | | - # | 23 | Project | 21 | | - # | 21 | Filter | 13 | | - # | 13 | BiInnerJoin | 9, 12 | | - # | 9 | BiInnerJoin | 5, 8 | | - # | 5 | AppendVertices | 4 | { "props": "[{\"props\":[\"name\"],\"tagId\":2}]" } | - # | 4 | Traverse | 2 | { "vertexProps": "[{\"props\":[\"name\"],\"tagId\":2}]" } | - # | 2 | Dedup | 1 | | - # | 1 | PassThrough | 3 | | - # | 3 | Start | | | - # | 8 | AppendVertices | 7 | { "props": "[{\"tagId\":2,\"props\":[\"name\"]}, {\"tagId\":3,\"props\":[\"name\"]}]" } | - # | 7 | Traverse | 6 | { "vertexProps": "[{\"tagId\":2,\"props\":[\"name\"]}]" } | - # | 6 | Argument | | | - # | 12 | AppendVertices | 11 | { "props": "[{\"props\":[\"name\"],\"tagId\":2}]" } | - # | 11 | Traverse | 10 | { "vertexProps": "[{\"props\":[\"name\"],\"tagId\":3}]" } | - # | 10 | Argument | | | - # Below scenario is not suppoted for the execution plan has a scan. + # Below scenario is not supported for the execution plan has a scan. When executing query: """ MATCH (m)-[]-(n), (a)-[]-(c) WHERE id(m)=="Tim Duncan" @@ -124,7 +70,7 @@ Feature: Multi Query Parts Then a ExecutionError should be raised at runtime: Scan vertices or edges need to specify a limit number, or limit number can not push down. Scenario: Multi Match - When profiling query: + When executing query: """ MATCH (m)-[]-(n) WHERE id(m)=="Tim Duncan" MATCH (n)-[]-(l) @@ -144,24 +90,7 @@ Feature: Multi Query Parts | "Tim Duncan" | "Boris Diaw" | "Spurs" | | "Tim Duncan" | "Boris Diaw" | "Suns" | | "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 | | - # | 19 | Project | 18 | | - # | 18 | Filter | 5 | | - # | 5 | AppendVertices | 4 | { "props": "[{\"props\":[\"name\"],\"tagId\":2}]" } | - # | 4 | Traverse | 2 | { "vertexProps": "[{\"props\":[\"name\"],\"tagId\":2}]" } | - # | 2 | Dedup | 1 | | - # | 1 | PassThrough | 3 | | - # | 3 | Start | | | - # | 11 | Project | 10 | | - # | 10 | AppendVertices | 9 | { "props": "[{\"tagId\":2,\"props\":[\"name\"]}, {\"tagId\":3,\"props\":[\"name\"]}]" } | - # | 9 | Traverse | 8 | { "vertexProps": "[{\"tagId\":2,\"props\":[\"name\"]}]" } | - # | 8 | Argument | | | - When profiling query: + When executing query: """ MATCH (m)-[]-(n) WHERE id(m)=="Tim Duncan" MATCH (n)-[]-(l), (l)-[]-(h) @@ -180,28 +109,7 @@ Feature: Multi Query Parts | "Tim Duncan" | "Aron Baynes" | "Pistons" | "Grant Hill" | | "Tim Duncan" | "Aron Baynes" | "Spurs" | "Aron Baynes" | | "Tim Duncan" | "Aron Baynes" | "Spurs" | "Boris Diaw" | - # And the execution plan should be: - # | id | name | dependencies | operator info | - # | 20 | DataCollect | 21 | | - # | 21 | TopN | 17 | | - # | 17 | Project | 16 | | - # | 16 | BiInnerJoin | 23, 15 | | - # | 23 | Project | 22 | | - # | 22 | Filter | 5 | | - # | 5 | AppendVertices | 4 | { "props": "[{\"props\":[\"name\"],\"tagId\":2}]" } | - # | 4 | Traverse | 2 | { "vertexProps": "[{\"props\":[\"name\"],\"tagId\":2}]" } | - # | 2 | Dedup | 1 | | - # | 1 | PassThrough | 3 | | - # | 3 | Start | | | - # | 15 | Project | 14 | | - # | 14 | BiInnerJoin | 10, 13 | | - # | 10 | AppendVertices | 9 | { "props": "[{\"tagId\":2,\"props\":[\"name\"]}, {\"tagId\":3,\"props\":[\"name\"]}]" } | - # | 9 | Traverse | 8 | { "vertexProps": "[{\"tagId\":2,\"props\":[\"name\"]}]" } | - # | 8 | Argument | | | - # | 13 | AppendVertices | 12 | { "props": "[{\"tagId\":2,\"props\":[\"name\"]}, {\"tagId\":3,\"props\":[\"name\"]}]" } | - # | 12 | Traverse | 11 | { "vertexProps": "[{\"tagId\":3,\"props\":[\"name\"]}]" } | - # | 11 | Argument | | | - When profiling query: + When executing query: """ MATCH (m)-[]-(n) WHERE id(m)=="Tim Duncan" MATCH (n)-[]-(l) @@ -221,7 +129,7 @@ Feature: Multi Query Parts | "Tim Duncan" | "Aron Baynes" | "Pistons" | "Grant Hill" | | "Tim Duncan" | "Aron Baynes" | "Spurs" | "Aron Baynes" | | "Tim Duncan" | "Aron Baynes" | "Spurs" | "Boris Diaw" | - When profiling query: + When executing query: """ MATCH (v:player{name:"Tony Parker"}) WITH v AS a @@ -233,20 +141,8 @@ Feature: Multi Query Parts | "Tim Duncan" | | "Tim Duncan" | - # And the execution plan should be: - # | id | name | dependencies | operator info | - # | 10 | Project | 11 | | - # | 11 | BiInnerJoin | 14, 9 | | - # | 14 | Project | 3 | | - # | 3 | AppendVertices | 12 | { "props": "[{\"props\":[\"name\"],\"tagId\":2}]" } | - # | 12 | IndexScan | 2 | | - # | 2 | Start | | | - # | 9 | Project | 8 | | - # | 8 | AppendVertices | 7 | { "props": "[{\"props\":[\"name\", \"_tag\"],\"tagId\":3}, {\"props\":[\"name\", \"age\", \"_tag\"],\"tagId\":2}, {\"props\":[\"name\", , \"speciality\", \"_tag\"],\"tagId\":4}, {\"props\":[\"id\", \"ts\", \"_tag\"],\"tagId\":6}]" } | - # | 7 | Traverse | 6 | { "vertexProps": "[{\"props\":[\"name\", \"_tag\"],\"tagId\":3}, {\"props\":[\"name\", \"age\", \"_tag\"],\"tagId\":2}, {\"props\":[\"name\", , \"speciality\", \"_tag\"],\"tagId\":4}, {\"props\":[\"id\", \"ts\", \"_tag\"],\"tagId\":6}]" } | - # | 6 | Argument | | | Scenario: Optional Match - When profiling query: + When executing query: """ MATCH (m)-[]-(n) WHERE id(m)=="Tim Duncan" OPTIONAL MATCH (n)<-[:serve]-(l) @@ -264,25 +160,8 @@ Feature: Multi Query Parts | "Tim Duncan" | "Manu Ginobili" | NULL | | "Tim Duncan" | "Manu Ginobili" | NULL | | "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 | | - # | 19 | Project | 18 | | - # | 18 | Filter | 5 | | - # | 5 | AppendVertices | 4 | { "props": "[{\"props\":[\"name\"],\"tagId\":2}]" } | - # | 4 | Traverse | 2 | | - # | 2 | Dedup | 1 | | - # | 1 | PassThrough | 3 | | - # | 3 | Start | | | - # | 11 | Project | 10 | | - # | 10 | AppendVertices | 9 | { "props": "[{\"props\":[\"name\", \"_tag\"],\"tagId\":3}, {\"props\":[\"name\", \"age\", \"_tag\"],\"tagId\":2}, {\"props\":[\"name\", , \"speciality\", \"_tag\"],\"tagId\":4}, {\"props\":[\"id\", \"ts\", \"_tag\"],\"tagId\":6}]" } | - # | 9 | Traverse | 8 | { "vertexProps": "[{\"props\":[\"name\"],\"tagId\":2}]" } | - # | 8 | Argument | | | - # Below scenario is not suppoted for the execution plan has a scan. - When profiling query: + # Below scenario is not supported for the execution plan has a scan. + When executing query: """ MATCH (m)-[]-(n) WHERE id(m)=="Tim Duncan" OPTIONAL MATCH (a)<-[]-(b) @@ -291,7 +170,7 @@ Feature: Multi Query Parts Then a ExecutionError should be raised at runtime: Scan vertices or edges need to specify a limit number, or limit number can not push down. Scenario: Multi Query Parts - When profiling query: + When executing query: """ MATCH (m)-[]-(n) WHERE id(m)=="Tim Duncan" WITH n, n.player.name AS n1 ORDER BY n1 LIMIT 10 @@ -312,7 +191,7 @@ Feature: Multi Query Parts | "Boris Diaw" | "Spurs" | | "Boris Diaw" | "Suns" | | "Boris Diaw" | "Tim Duncan" | - When profiling query: + When executing query: """ MATCH (m:player{name:"Tim Duncan"})-[:like]-(n)--() WITH m,count(*) AS lcount @@ -322,7 +201,7 @@ Feature: Multi Query Parts Then the result should be, in order: | scount | lcount | | 19 | 110 | - When profiling query: + When executing query: """ MATCH (m:player{name:"Tim Duncan"})-[:like]-(n)--() WITH m,n @@ -332,21 +211,7 @@ Feature: Multi Query Parts Then the result should be, in order: | scount | | 270 | - # And the execution plan should be: - # | id | name | dependencies | operator info | - # | 12 | Aggregate | 13 | | - # | 13 | BiInnerJoin | 15, 11 | | - # | 15 | Project | 5 | | - # | 5 | AppendVertices | 4 | { "props": "[]" } | - # | 4 | Traverse | 3 | { "vertexProps": "" } | - # | 3 | Traverse | 14 | { "vertexProps": "[{\"props\":[\"name\"],\"tagId\":2}]" } | - # | 14 | IndexScan | 2 | | - # | 2 | Start | | | - # | 11 | Project | 10 | | - # | 10 | AppendVertices | 9 | { "props": "[]" } | - # | 9 | Traverse | 8 | { "vertexProps": "[{\"props\":[\"name\"],\"tagId\":2}]" } | - # | 8 | Argument | | | - # Below scenario is not suppoted for the execution plan has a scan. + # Below scenario is not supported for the execution plan has a scan. When executing query: """ MATCH (m)-[]-(n) WHERE id(m)=="Tim Duncan" @@ -357,14 +222,14 @@ Feature: Multi Query Parts Then a ExecutionError should be raised at runtime: Scan vertices or edges need to specify a limit number, or limit number can not push down. Scenario: Some Erros - When profiling query: + When executing query: """ MATCH (m)-[]-(n) WHERE id(m)=="Tim Duncan" WITH n, n.player.name AS n1 ORDER BY n1 LIMIT 10 RETURN m """ Then a SemanticError should be raised at runtime: Alias used but not defined: `m' - When profiling query: + When executing query: """ MATCH (v:player)-[e]-(v:team) RETURN v, e """ diff --git a/tests/tck/features/yield/NoSpaceChosen.feature b/tests/tck/features/yield/NoSpaceChosen.feature index 5a30e0a6c32..3c79382d44f 100644 --- a/tests/tck/features/yield/NoSpaceChosen.feature +++ b/tests/tck/features/yield/NoSpaceChosen.feature @@ -1,4 +1,3 @@ -@wang Feature: Yield Background: