diff --git a/tests/tck/conftest.py b/tests/tck/conftest.py index 4d06bbf6c0b..2d604689fe4 100644 --- a/tests/tck/conftest.py +++ b/tests/tck/conftest.py @@ -195,7 +195,7 @@ def preload_space( elif space == "ldbc_v0_3_3": exec_ctx["ldbc_v0_3_3"] = load_ldbc_v0_3_3 elif space == "test": - exec_ctx["test"] = load_test_data + exec_ctx["space_desc"] = load_test_data else: raise ValueError(f"Invalid space name given: {space}") diff --git a/tests/tck/features/match/Path.feature b/tests/tck/features/match/Path.feature new file mode 100644 index 00000000000..ea2ec112b8a --- /dev/null +++ b/tests/tck/features/match/Path.feature @@ -0,0 +1,74 @@ +# Copyright (c) 2020 vesoft inc. All rights reserved. +# +# This source code is licensed under Apache 2.0 License. +Feature: Matching paths + + Background: + Given load "test" csv data to a new space + + Scenario: distinct edges and paths + When executing query: + """ + match p = (v:Label_0)-[e:Rel_0]-(v1:Label_1)-[e1:Rel_1]-(v2:Label_2), + p = (v:Label_0)-[e:Rel_0]-(v1:Label_1)-[e1:Rel_1]-(v2:Label_2) + return * + """ + Then a SemanticError should be raised at runtime: `e': Redefined alias + When executing query: + """ + match p = (v:Label_0)-[e:Rel_0]-(v1:Label_1)-[e1:Rel_1]-(v2:Label_2), + p = (v:Label_0)-[e2:Rel_0]-(v1:Label_1)-[e1:Rel_1]-(v2:Label_2) + return * + """ + Then a SemanticError should be raised at runtime: `e1': Redefined alias + When executing query: + """ + match p = (v:Label_0)-[e:Rel_0]-(v1:Label_1)-[e1:Rel_1]-(v2:Label_2), + p = (v:Label_0)-[e2:Rel_0]-(v1:Label_1)-[er:Rel_1]-(v2:Label_2) + return * + """ + Then a SemanticError should be raised at runtime: `p': Redefined alias + When executing query: + """ + match p = (v:Label_5)-[e:Rel_0]-(v1:Label_1)-[e1:Rel_1]-(v2:Label_2), + p2 = (v:Label_8)-[e2:Rel_0]-(v1:Label_1)-[e3:Rel_1]-(v2:Label_2) + return count(p), count(p2) + """ + Then the result should be, in any order: + | count(p) | count(p2) | + | 966 | 966 | + + Scenario: symmetry paths + When executing query: + """ + match p1 = (v1)-[e*1..2]->(v2) where id(v1) in [6] + match p2 = (v2)-[e*1..2]->(v1) + return count(*) + """ + Then the result should be, in any order: + | count(*) | + | 16 | + When executing query: + """ + match p1 = (v1)-[e*1..2]->(v2) where id(v1) in [6] + match p2 = (v2)-[e*1..2]->(v1) + return size(e) + """ + Then the result should be, in any order: + | size(e) | + | 1 | + | 1 | + | 1 | + | 1 | + | 2 | + | 2 | + | 2 | + | 2 | + | 2 | + | 2 | + | 2 | + | 2 | + | 2 | + | 2 | + | 2 | + | 2 | diff --git a/tests/tck/features/optimizer/CasesUsingTestSpace.feature b/tests/tck/features/optimizer/CasesUsingTestSpace.feature new file mode 100644 index 00000000000..d1029309f9b --- /dev/null +++ b/tests/tck/features/optimizer/CasesUsingTestSpace.feature @@ -0,0 +1,41 @@ +# Copyright (c) 2022 vesoft inc. All rights reserved. +# +# This source code is licensed under Apache 2.0 License. +Feature: Push Filter Down Cases Using the test Space + + Background: + Given load "test" csv data to a new space + + Scenario: push filter down hash join bug fix + When profiling query: + """ + MATCH (v1:Label_6:Label_3)<-[e2:Rel_1]-(:Label_5)-[e3]->(v2) + WHERE (id(v1) in [20, 28, 31, 6, 4, 18, 15, 25, 9, 19, 21]) + MATCH p0 = (v2)<-[e4]-()-[e5]->(v3:Label_6) + WITH min(v3.Label_6.Label_6_4_Int) AS pa0, + v3.Label_6.Label_6_1_Bool AS pa2 + WHERE pa2 + RETURN pa2 + """ + Then the result should be, in any order: + | pa2 | + | true | + And the execution plan should be: + | id | name | dependencies | operator info | + | 17 | project | 19 | | + | 19 | aggregate | 24 | | + | 24 | HashInnerJoin | 21,29 | | + | 21 | project | 20 | | + | 20 | filter | 6 | | + | 6 | AppendVertices | 26 | | + | 26 | Traverse | 25 | | + | 25 | Traverse | 2 | | + | 2 | Dedup | 1 | | + | 1 | PassThrough | 3 | | + | 3 | Start | | | + | 29 | project | 28 | | + | 28 | Filter | 27 | {"condition": "$-.v3.Label_6.Label_6_1_Bool"} | + | 27 | AppendVertices | 11 | | + | 11 | Traverse | 10 | | + | 10 | Traverse | 9 | | + | 9 | Argument | | | diff --git a/tests/tck/features/optimizer/PushFilterDownHashInnerJoinRule.feature b/tests/tck/features/optimizer/PushFilterDownHashInnerJoinRule.feature index 7f9b53eecd4..4e0b3c36732 100644 --- a/tests/tck/features/optimizer/PushFilterDownHashInnerJoinRule.feature +++ b/tests/tck/features/optimizer/PushFilterDownHashInnerJoinRule.feature @@ -256,39 +256,3 @@ Feature: Push Filter down HashInnerJoin rule | 10 | Traverse | 8 | | | 8 | Argument | 9 | | | 9 | Start | | | - - Scenario: push filter down hash join bug fix - Given an empty graph - And load "test" csv data to a new space - When profiling query: - """ - MATCH (v1:Label_6:Label_3)<-[e2:Rel_1]-(:Label_5)-[e3]->(v2) - WHERE (id(v1) in [20, 28, 31, 6, 4, 18, 15, 25, 9, 19, 21]) - MATCH p0 = (v2)<-[e4]-()-[e5]->(v3:Label_6) - WITH min(v3.Label_6.Label_6_4_Int) AS pa0, - v3.Label_6.Label_6_1_Bool AS pa2 - WHERE pa2 - RETURN pa2 - """ - Then the result should be, in any order: - | pa2 | - | true | - And the execution plan should be: - | id | name | dependencies | operator info | - | 17 | project | 19 | | - | 19 | aggregate | 24 | | - | 24 | HashInnerJoin | 21,29 | | - | 21 | project | 20 | | - | 20 | filter | 6 | | - | 6 | AppendVertices | 26 | | - | 26 | Traverse | 25 | | - | 25 | Traverse | 2 | | - | 2 | Dedup | 1 | | - | 1 | PassThrough | 3 | | - | 3 | Start | | | - | 29 | project | 28 | | - | 28 | Filter | 27 | {"condition": "$-.v3.Label_6.Label_6_1_Bool"} | - | 27 | AppendVertices | 11 | | - | 11 | Traverse | 10 | | - | 10 | Traverse | 9 | | - | 9 | Argument | | |