diff --git a/tests/tck/features/match/MatchById.feature b/tests/tck/features/match/MatchById.feature index c679c7d6486..f53e3ed01b4 100644 --- a/tests/tck/features/match/MatchById.feature +++ b/tests/tck/features/match/MatchById.feature @@ -1031,7 +1031,7 @@ Feature: Match By Id """ OPTIONAL MATCH (n) OPTIONAL MATCH (n) WHERE id(n) == 'James Harden' RETURN n """ - 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. + Then a SyntaxError should be raised at runtime: Where clause in optional match is not supported. near `WHERE id(n) == 'James Harden'' When executing query: """ MATCH (v1)-[:like]->(v2:player)-[:serve]->(v3) diff --git a/tests/tck/features/match/MultiLineMultiQueryParts.feature b/tests/tck/features/match/MultiLineMultiQueryParts.feature index 7f1c72a40ca..1f0030c2831 100644 --- a/tests/tck/features/match/MultiLineMultiQueryParts.feature +++ b/tests/tck/features/match/MultiLineMultiQueryParts.feature @@ -197,103 +197,63 @@ Feature: Multi Line Multi Query Parts OPTIONAL MATCH (n)-[]->(l) WHERE id(n)=="Tony Parker" RETURN id(m) AS m, id(n) AS n, id(l) AS l; """ - Then the result should be, in any order: - | m | n | l | - | "Tim Duncan" | "Spurs" | NULL | - | "Tim Duncan" | "LaMarcus Aldridge" | NULL | - | "Tim Duncan" | "Tony Parker" | "Spurs" | - | "Tim Duncan" | "Tony Parker" | "LaMarcus Aldridge" | - | "Tim Duncan" | "Tony Parker" | "LaMarcus Aldridge" | - | "Tim Duncan" | "Tony Parker" | "Kyle Anderson" | - | "Tim Duncan" | "Tony Parker" | "Tim Duncan" | - | "Tim Duncan" | "Tony Parker" | "Tim Duncan" | - | "Tim Duncan" | "Tony Parker" | "Manu Ginobili" | - | "Tim Duncan" | "Tony Parker" | "Manu Ginobili" | - | "Tim Duncan" | "Tony Parker" | "Hornets" | - | "Tim Duncan" | "Tony Parker" | "Spurs" | - | "Tim Duncan" | "Tony Parker" | "LaMarcus Aldridge" | - | "Tim Duncan" | "Tony Parker" | "LaMarcus Aldridge" | - | "Tim Duncan" | "Tony Parker" | "Kyle Anderson" | - | "Tim Duncan" | "Tony Parker" | "Tim Duncan" | - | "Tim Duncan" | "Tony Parker" | "Tim Duncan" | - | "Tim Duncan" | "Tony Parker" | "Manu Ginobili" | - | "Tim Duncan" | "Tony Parker" | "Manu Ginobili" | - | "Tim Duncan" | "Tony Parker" | "Hornets" | - | "Tim Duncan" | "Danny Green" | NULL | - | "Tim Duncan" | "Manu Ginobili" | NULL | - | "Tim Duncan" | "Manu Ginobili" | NULL | + Then a SyntaxError should be raised at runtime: Where clause in optional match is not supported. near `WHERE id(n)=="Tony Parker"' When executing query: """ OPTIONAL match (v:player) WHERE v.player.age > 41 MATCH (v:player) WHERE v.player.age>40 RETURN count(*) AS count """ - Then the result should be, in order: - | count | - | 7 | + Then a SyntaxError should be raised at runtime: Where clause in optional match is not supported. near `WHERE v.player.age > 41' When executing query: """ - OPTIONAL match (v:player) WHERE v.player.age>43 + OPTIONAL match (v:player) WHERE v.player.age > 43 MATCH (n:player) WHERE n.player.age>40 RETURN count(*) AS count """ - Then the result should be, in order: - | count | - | 32 | + Then a SyntaxError should be raised at runtime: Where clause in optional match is not supported. near `WHERE v.player.age > 43' When executing query: """ - OPTIONAL MATCH (v:player) WHERE v.player.age > 40 and v.player.age<46 + OPTIONAL MATCH (v:player) WHERE v.player.age > 40 and v.player.age < 46 MATCH (v:player) WHERE v.player.age>43 RETURN count(*) AS count """ - Then the result should be, in any order: - | count | - | 2 | + Then a SyntaxError should be raised at runtime: Where clause in optional match is not supported. near `WHERE v.player.age > 40 and v.player.age < 46' When executing query: """ - MATCH (v:player) WHERE v.player.age > 40 and v.player.age<46 - OPTIONAL MATCH (v:player) WHERE v.player.age>43 + MATCH (v:player) WHERE v.player.age > 40 and v.player.age < 46 + OPTIONAL MATCH (v:player) WHERE v.player.age > 43 RETURN count(*) AS count """ - Then the result should be, in any order: - | count | - | 6 | + Then a SyntaxError should be raised at runtime: Where clause in optional match is not supported. near `WHERE v.player.age > 43' When executing query: """ OPTIONAL MATCH (v:player) WHERE v.player.age > 40 and v.player.age<46 OPTIONAL MATCH (v:player) WHERE v.player.age>43 RETURN count(*) AS count """ - Then the result should be, in any order: - | count | - | 6 | + Then a SyntaxError should be raised at runtime: Where clause in optional match is not supported. near `WHERE v.player.age > 40 and v.player.age<46' When executing query: """ - OPTIONAL MATCH (v:player) WHERE v.player.age>43 + OPTIONAL MATCH (v:player) WHERE v.player.age > 43 MATCH (v:player) WHERE v.player.age > 40 and v.player.age<46 RETURN count(*) AS count """ - Then the result should be, in any order: - | count | - | 2 | + Then a SyntaxError should be raised at runtime: Where clause in optional match is not supported. near `WHERE v.player.age > 43' When executing query: """ - MATCH (v:player) WHERE v.player.age>43 - OPTIONAL MATCH (v:player) WHERE v.player.age > 40 and v.player.age<46 + MATCH (v:player) WHERE v.player.age > 43 + OPTIONAL MATCH (v:player) WHERE v.player.age > 40 and v.player.age < 46 RETURN count(*) AS count """ - Then the result should be, in any order: - | count | - | 4 | + Then a SyntaxError should be raised at runtime: Where clause in optional match is not supported. near `WHERE v.player.age > 40 and v.player.age < 46' When executing query: """ - OPTIONAL MATCH (v:player) WHERE v.player.age>43 - OPTIONAL MATCH (v:player) WHERE v.player.age > 40 and v.player.age<46 + OPTIONAL MATCH (v:player) WHERE v.player.age > 43 + OPTIONAL MATCH (v:player) WHERE v.player.age > 40 and v.player.age < 46 RETURN count(*) AS count """ - Then the result should be, in any order: - | count | - | 4 | + Then a SyntaxError should be raised at runtime: Where clause in optional match is not supported. near `WHERE v.player.age > 43' # When the input of argument is NULL When executing query: """ @@ -370,22 +330,18 @@ Feature: Multi Line Multi Query Parts | 12 | When executing query: """ - OPTIONAL match (v:player) WHERE v.player.age>43 WITH v + OPTIONAL match (v:player) WHERE v.player.age > 43 WITH v MATCH (v:player) WHERE v.player.age>40 WITH v RETURN count(*) AS count """ - Then the result should be, in order: - | count | - | 4 | + Then a SyntaxError should be raised at runtime: Where clause in optional match is not supported. near `WHERE v.player.age > 43' When executing query: """ - OPTIONAL match (v:player) WHERE v.player.age>43 WITH v + OPTIONAL match (v:player) WHERE v.player.age > 43 WITH v MATCH (n:player) WHERE n.player.age>40 WITH v, n RETURN count(*) AS count """ - Then the result should be, in order: - | count | - | 32 | + Then a SyntaxError should be raised at runtime: Where clause in optional match is not supported. near `WHERE v.player.age > 43' When executing query: """ MATCH (a:player{age:42}) WITH a @@ -411,10 +367,10 @@ Feature: Multi Line Multi Query Parts OPTIONAL MATCH (n)-->(v) WHERE v.player.age < m.player.age RETURN n,v """ - Then a SemanticError should be raised at runtime: The where clause of optional match statement that reference variables defined by other statements is not supported yet. + Then a SyntaxError should be raised at runtime: Where clause in optional match is not supported. near `WHERE v.player.age < m.player.age' When executing query: """ MATCH (m)-[]-(n) WHERE id(m)=="Tim Duncan" OPTIONAL MATCH (n)-->(v) WHERE id(v) < id(m) RETURN count(*) AS count """ - Then a SemanticError should be raised at runtime: The where clause of optional match statement that reference variables defined by other statements is not supported yet. + Then a SyntaxError should be raised at runtime: Where clause in optional match is not supported. near `WHERE id(v) < id(m)' diff --git a/tests/tck/features/match/MultiQueryParts.feature b/tests/tck/features/match/MultiQueryParts.feature index e722235b3a8..bc0be5fb87a 100644 --- a/tests/tck/features/match/MultiQueryParts.feature +++ b/tests/tck/features/match/MultiQueryParts.feature @@ -177,36 +177,40 @@ Feature: Multi Query Parts When profiling query: """ MATCH (v1:player)-[:like*2..2]->(v2)-[e3:like]->(v4) where id(v1) == "Tony Parker" - OPTIONAL MATCH (v3:player)-[:like]->(v1)<-[e5]-(v4) where id(v3) == "Tim Duncan" return * - """ - Then the result should be, in any order, with relax comparison: - | v1 | v2 | e3 | v4 | v3 | e5 | - | ("Tony Parker") | ("Tony Parker") | [:like "Tony Parker"->"LaMarcus Aldridge" @0] | ("LaMarcus Aldridge") | ("Tim Duncan") | [:like "LaMarcus Aldridge"->"Tony Parker" @0] | - | ("Tony Parker") | ("Tim Duncan") | [:like "Tim Duncan"->"Tony Parker" @0 ] | ("Tony Parker") | NULL | NULL | - | ("Tony Parker") | ("Tim Duncan") | [:like "Tim Duncan"->"Tony Parker" @0] | ("Tony Parker") | NULL | NULL | - | ("Tony Parker") | ("Tony Parker") | [:like "Tony Parker"->"Tim Duncan" @0 ] | ("Tim Duncan") | ("Tim Duncan") | [:teammate "Tim Duncan"->"Tony Parker" @0] | - | ("Tony Parker") | ("Manu Ginobili") | [:like "Manu Ginobili"->"Tim Duncan" @0 ] | ("Tim Duncan") | ("Tim Duncan") | [:teammate "Tim Duncan"->"Tony Parker" @0] | - | ("Tony Parker") | ("Tony Parker") | [:like "Tony Parker"->"Manu Ginobili" @0] | ("Manu Ginobili") | ("Tim Duncan") | [:teammate "Manu Ginobili"->"Tony Parker" @0] | - | ("Tony Parker") | ("Tony Parker") | [:like "Tony Parker"->"Manu Ginobili" @0 ] | ("Manu Ginobili") | ("Tim Duncan") | [:teammate "Manu Ginobili"->"Tony Parker" @0] | - | ("Tony Parker") | ("Tim Duncan") | [:like "Tim Duncan"->"Manu Ginobili" @0 ] | ("Manu Ginobili") | ("Tim Duncan") | [:teammate "Manu Ginobili"->"Tony Parker" @0 ] | - | ("Tony Parker") | ("Tim Duncan") | [:like "Tim Duncan"->"Manu Ginobili" @0] | ("Manu Ginobili") | ("Tim Duncan") | [:teammate "Manu Ginobili"->"Tony Parker" @0] | - # The redudant Project after HashLeftJoin is removed now - And the execution plan should be: + OPTIONAL MATCH (v3:player)-[:like]->(v1)<-[e5]-(v4) + with v1, v2, e3, v4, e5, v3 where id(v3) == "Tim Duncan" or id(v3) is NULL + return * + """ + Then the result should be,d in any order, with relax comparison: + | v1 | v2 | e3 | v4 | e5 | v3 | + | ("Tony Parker") | ("Tony Parker") | [:like "Tony Parker"->"LaMarcus Aldridge" @0] | ("LaMarcus Aldridge") | [:like "LaMarcus Aldridge"->"Tony Parker" @0] | ("Tim Duncan") | + | ("Tony Parker") | ("Tim Duncan") | [:like "Tim Duncan"->"Tony Parker" @0 ] | ("Tony Parker") | NULL | NULL | + | ("Tony Parker") | ("Tim Duncan") | [:like "Tim Duncan"->"Tony Parker" @0] | ("Tony Parker") | NULL | NULL | + | ("Tony Parker") | ("Tony Parker") | [:like "Tony Parker"->"Tim Duncan" @0 ] | ("Tim Duncan") | [:teammate "Tim Duncan"->"Tony Parker" @0] | ("Tim Duncan") | + | ("Tony Parker") | ("Manu Ginobili") | [:like "Manu Ginobili"->"Tim Duncan" @0 ] | ("Tim Duncan") | [:teammate "Tim Duncan"->"Tony Parker" @0] | ("Tim Duncan") | + | ("Tony Parker") | ("Tony Parker") | [:like "Tony Parker"->"Manu Ginobili" @0] | ("Manu Ginobili") | [:teammate "Manu Ginobili"->"Tony Parker" @0] | ("Tim Duncan") | + | ("Tony Parker") | ("Tony Parker") | [:like "Tony Parker"->"Manu Ginobili" @0 ] | ("Manu Ginobili") | [:teammate "Manu Ginobili"->"Tony Parker" @0] | ("Tim Duncan") | + | ("Tony Parker") | ("Tim Duncan") | [:like "Tim Duncan"->"Manu Ginobili" @0 ] | ("Manu Ginobili") | [:teammate "Manu Ginobili"->"Tony Parker" @0 ] | ("Tim Duncan") | + | ("Tony Parker") | ("Tim Duncan") | [:like "Tim Duncan"->"Manu Ginobili" @0] | ("Manu Ginobili") | [:teammate "Manu Ginobili"->"Tony Parker" @0] | ("Tim Duncan") | + # The redudant Project after HashInnerJoin is removed now + Then the execution plan should be: | id | name | dependencies | profiling data | operator info | - | 19 | HashLeftJoin | 7,14 | | | - | 7 | Project | 6 | | | + | 22 | Project | 18 | | | + | 18 | Filter | 14 | | | + | 14 | HashLeftJoin | 7,13 | | | + | 7 | project | 6 | | | | 6 | AppendVertices | 5 | | | | 5 | Traverse | 20 | | | | 20 | Traverse | 2 | | | | 2 | Dedup | 1 | | | | 1 | PassThrough | 3 | | | | 3 | Start | | | | - | 14 | Project | 13 | | | - | 13 | Traverse | 21 | | | - | 21 | Traverse | 9 | | | - | 9 | Dedup | 8 | | | - | 8 | PassThrough | 10 | | | - | 10 | Start | | | | + | 13 | Project | 21 | | | + | 21 | AppendVertices | 11 | | | + | 11 | Traverse | 10 | | | + | 10 | AppendVertices | 9 | | | + | 9 | Traverse | 8 | | | + | 8 | Argument | | | | When executing query: """ MATCH (m)-[]-(n) WHERE id(m)=="Tim Duncan" diff --git a/tests/tck/features/optimizer/PrunePropertiesRule.feature b/tests/tck/features/optimizer/PrunePropertiesRule.feature index 5c4473a7be1..2b8193a8ebe 100644 --- a/tests/tck/features/optimizer/PrunePropertiesRule.feature +++ b/tests/tck/features/optimizer/PrunePropertiesRule.feature @@ -539,7 +539,6 @@ Feature: Prune Properties rule WHERE id(v) == 'Tim Duncan' AND b.player.age > 20 WITH v, count(b) AS countB, t OPTIONAL MATCH (v)-[:like]-()<-[:like]-(oldB)-[:serve]->(t) - WHERE oldB.player.age > 10 WITH v, countB, t, count(oldB) AS cb RETURN t.team.name, sum(countB) """ @@ -549,25 +548,23 @@ Feature: Prune Properties rule | "Hornets" | 3 | And the execution plan should be: | id | name | dependencies | operator info | - | 21 | Aggregate | 20 | | - | 20 | Aggregate | 19 | | - | 19 | HashLeftJoin | 10, 25 | | - | 10 | Aggregate | 23 | | - | 23 | Project | 22 | | - | 22 | Filter | 29 | | - | 29 | AppendVertices | 28 | { "props": "[{ \"props\":[\"name\",\"age\",\"_tag\"]},{\"props\":[\"name\",\"speciality\",\"_tag\"] },{ \"props\":[\"name\",\"_tag\"]}]" } | - | 28 | Traverse | 27 | {"vertexProps": "[{\"props\":[\"age\"] }]", "edgeProps": "[{ \"props\": [\"_type\", \"_rank\", \"_dst\"]}]" } | - | 27 | Traverse | 26 | {"vertexProps": "", "edgeProps": "[{ \"props\": [\"_type\", \"_rank\", \"_dst\"]}]" } | - | 26 | Traverse | 2 | {"vertexProps": "[{ \"props\":[\"name\",\"age\",\"_tag\"]},{\"props\":[\"name\",\"speciality\",\"_tag\"] },{ \"props\":[\"name\",\"_tag\"]}]", "edgeProps": "[{ \"props\": [\"_type\", \"_rank\", \"_dst\"]}, { \"props\": [\"_type\", \"_rank\", \"_dst\"]}]" } | + | 19 | Aggregate | 18 | | + | 18 | Aggregate | 27 | | + | 27 | HashLeftJoin | 10,26 | | + | 10 | Aggregate | 21 | | + | 21 | Project | 20 | | + | 20 | Filter | 25 | | + | 25 | AppendVertices | 24 | { "props": "[{ \"props\":[\"name\",\"age\",\"_tag\"]},{\"props\":[\"name\",\"speciality\",\"_tag\"] },{ \"props\":[\"name\",\"_tag\"]}]" } | + | 24 | Traverse | 23 | {"vertexProps": "[{ \"props\":[\"age\"]}]", "edgeProps": "[{ \"props\": [\"_type\", \"_rank\", \"_dst\"]}]" } | + | 23 | Traverse | 22 | {"vertexProps": "", "edgeProps": "[{ \"props\": [\"_type\", \"_rank\", \"_dst\"]}]" } | + | 22 | Traverse | 2 | {"vertexProps": "[{ \"props\":[\"name\",\"age\",\"_tag\"]},{\"props\":[\"name\",\"speciality\",\"_tag\"] },{ \"props\":[\"name\",\"_tag\"]}]", "edgeProps": "[{ \"props\": [\"_type\", \"_rank\", \"_dst\"]}, { \"props\": [\"_type\", \"_rank\", \"_dst\"]}]" } | | 2 | Dedup | 1 | | | 1 | PassThrough | 3 | | | 3 | Start | | | - | 25 | Project | 24 | | - | 24 | Filter | 16 | | - | 16 | AppendVertices | 15 | { "props": "[{ \"props\":[\"name\",\"age\",\"_tag\"]},{\"props\":[\"name\",\"speciality\",\"_tag\"] },{ \"props\":[\"name\",\"_tag\"]}]"} | - | 15 | Traverse | 14 | {"vertexProps": "[{\"props\":[\"age\"] }]", "edgeProps": "[{ \"props\": [\"_type\", \"_rank\", \"_dst\"]}]" } | - | 14 | Traverse | 13 | {"vertexProps": "", "edgeProps": "[{ \"props\": [\"_type\", \"_rank\", \"_dst\"]}]" } | - | 13 | Traverse | 11 | {"vertexProps": "[{ \"props\":[\"name\",\"age\",\"_tag\"]},{\"props\":[\"name\",\"speciality\",\"_tag\"] },{ \"props\":[\"name\",\"_tag\"]}]", "edgeProps": "[{ \"props\": [\"_type\", \"_rank\", \"_dst\"]}, { \"props\": [\"_type\", \"_rank\", \"_dst\"]}]" } | + | 26 | Project | 14 | | + | 14 | Traverse | 13 | {"vertexProps": "", "edgeProps": "[{ \"props\": [\"_src\", \"_type\", \"_rank\", \"_dst\", \"start_year\", \"end_year\"]}]" } | + | 13 | Traverse | 12 | {"vertexProps": "", "edgeProps": "[{ \"props\": [\"_type\", \"_rank\", \"_dst\"]}]" } | + | 12 | Traverse | 11 | {"vertexProps": "[{ \"props\":[\"name\",\"age\",\"_tag\"]},{\"props\":[\"name\",\"speciality\",\"_tag\"] },{ \"props\":[\"name\",\"_tag\"]}]", "edgeProps": "[{ \"props\": [\"_type\", \"_rank\", \"_dst\"]}, { \"props\": [\"_type\", \"_rank\", \"_dst\"]}]" } | | 11 | Argument | | | @distonly diff --git a/tests/tck/ldbc/business_intelligence_workload/Read.feature b/tests/tck/ldbc/business_intelligence_workload/Read.feature index 523aa4d4788..176e00420f9 100644 --- a/tests/tck/ldbc/business_intelligence_workload/Read.feature +++ b/tests/tck/ldbc/business_intelligence_workload/Read.feature @@ -115,8 +115,7 @@ Feature: LDBC Business Intelligence Workload - Read tagName ASC LIMIT 100 """ - Then the result should be, in any order: - | tagName | countMonth1 | countMonth2 | diff | + Then a SyntaxError should be raised at runtime: Where clause in optional match is not supported. near `WHERE datetime('2012-06-01') <= message1.Message.creationDate AND message1.Messa' Scenario: 4. Popular topics in a country When executing query: @@ -530,8 +529,7 @@ Feature: LDBC Business Intelligence Workload - Read personCount DESC, messageCount DESC """ - Then the result should be, in order: - | messageCount | personCount | + Then a SyntaxError should be raised at runtime: Where clause in optional match is not supported. near `WHERE message.Message.content IS NOT NULL AND message.Message.length < 20 AND me' Scenario: 19. Stranger’s interaction # NOTICE: A big rewritten, have to test the correctness diff --git a/tests/tck/ldbc/interactive_workload/ComplexReads.feature b/tests/tck/ldbc/interactive_workload/ComplexReads.feature index dc7321b1be1..a0b470ebc59 100644 --- a/tests/tck/ldbc/interactive_workload/ComplexReads.feature +++ b/tests/tck/ldbc/interactive_workload/ComplexReads.feature @@ -137,8 +137,7 @@ Feature: LDBC Interactive Workload - Complex Reads sum(postsOnTag) AS postCount ORDER BY postCount DESC, tagName ASC """ - Then the result should be, in any order: - | tagName | postCount | + Then a SyntaxError should be raised at runtime: Where clause in optional match is not supported. near `WHERE oldPost.Post.creationDate < $startDate' Scenario: 5. New groups # {"personId":"6597069766734","minDate":"1288612800000"}