From b85ae3c9a354e71183d3aa4edada117b2d04166c Mon Sep 17 00:00:00 2001 From: jimingquan Date: Wed, 28 Dec 2022 14:25:26 +0800 Subject: [PATCH] delete unused keyword step (#5117) * delete unused keyword step * fix test error Co-authored-by: Sophie <84560950+Sophie-Xie@users.noreply.github.com> --- src/parser/scanner.lex | 1 - src/parser/test/ScannerTest.cpp | 2 -- .../features/delete/DeleteVertexWithoutEdge.feature | 12 ++++++------ tests/tck/features/go/SimpleCase.feature | 10 +++++----- tests/tck/features/insert/insertVertexOnly.feature | 2 +- 5 files changed, 12 insertions(+), 15 deletions(-) diff --git a/src/parser/scanner.lex b/src/parser/scanner.lex index a6fedde4a68..5a24f82a377 100644 --- a/src/parser/scanner.lex +++ b/src/parser/scanner.lex @@ -115,7 +115,6 @@ LABEL_FULL_WIDTH {CN_EN_FULL_WIDTH}{CN_EN_NUM_FULL_WIDTH}* "LOOKUP" { return TokenType::KW_LOOKUP; } "ALTER" { return TokenType::KW_ALTER; } "STEPS" { return TokenType::KW_STEPS; } -"STEP" { return TokenType::KW_STEPS; } "OVER" { return TokenType::KW_OVER; } "UPTO" { return TokenType::KW_UPTO; } "REVERSELY" { return TokenType::KW_REVERSELY; } diff --git a/src/parser/test/ScannerTest.cpp b/src/parser/test/ScannerTest.cpp index f1b0675166e..3536a0b19fa 100644 --- a/src/parser/test/ScannerTest.cpp +++ b/src/parser/test/ScannerTest.cpp @@ -199,8 +199,6 @@ TEST(Scanner, Basic) { CHECK_SEMANTIC_TYPE("update", TokenType::KW_UPDATE), CHECK_SEMANTIC_TYPE("ALTER", TokenType::KW_ALTER), CHECK_SEMANTIC_TYPE("alter", TokenType::KW_ALTER), - CHECK_SEMANTIC_TYPE("STEP", TokenType::KW_STEPS), - CHECK_SEMANTIC_TYPE("step", TokenType::KW_STEPS), CHECK_SEMANTIC_TYPE("STEPS", TokenType::KW_STEPS), CHECK_SEMANTIC_TYPE("steps", TokenType::KW_STEPS), CHECK_SEMANTIC_TYPE("OVER", TokenType::KW_OVER), diff --git a/tests/tck/features/delete/DeleteVertexWithoutEdge.feature b/tests/tck/features/delete/DeleteVertexWithoutEdge.feature index 74494df5299..2b5416b88f4 100644 --- a/tests/tck/features/delete/DeleteVertexWithoutEdge.feature +++ b/tests/tck/features/delete/DeleteVertexWithoutEdge.feature @@ -25,7 +25,7 @@ Feature: delete vertex without edge Then the execution should be successful When executing query: """ - GO 1 STEP FROM 1 OVER e YIELD e._dst AS dst, $^.t.id as id; + GO 1 STEPS FROM 1 OVER e YIELD e._dst AS dst, $^.t.id as id; """ Then the result should be, in any order: | dst | id | @@ -50,7 +50,7 @@ Feature: delete vertex without edge | e | When executing query: """ - GO 1 STEP FROM 1 OVER e YIELD e._dst AS dst, $^.t.id as id + GO 1 STEPS FROM 1 OVER e YIELD e._dst AS dst, $^.t.id as id """ Then the result should be, in any order: | dst | id | @@ -61,7 +61,7 @@ Feature: delete vertex without edge Then the execution should be successful When executing query: """ - GO 1 STEP FROM 1 OVER e YIELD e._dst AS dst, $^.t.id as id; + GO 1 STEPS FROM 1 OVER e YIELD e._dst AS dst, $^.t.id as id; """ Then the result should be, in any order: | dst | id | @@ -82,7 +82,7 @@ Feature: delete vertex without edge Then the execution should be successful When executing query: """ - GO 1 STEP FROM 1 OVER e YIELD e._dst AS a, $^.t.id AS id; + GO 1 STEPS FROM 1 OVER e YIELD e._dst AS a, $^.t.id AS id; """ Then the result should be, in any order: | a | id | @@ -108,7 +108,7 @@ Feature: delete vertex without edge | [:e 1->2 @0 {}] | When executing query: """ - GO 1 STEP FROM 1 OVER e YIELD e._dst AS b, $^.t.id as id; + GO 1 STEPS FROM 1 OVER e YIELD e._dst AS b, $^.t.id as id; """ Then the result should be, in any order: | b | id | @@ -121,7 +121,7 @@ Feature: delete vertex without edge Then the execution should be successful When executing query: """ - GO 1 STEP FROM 1 OVER e YIELD e._dst AS c, $^.t.id as id; + GO 1 STEPS FROM 1 OVER e YIELD e._dst AS c, $^.t.id as id; """ Then the result should be, in any order: | c | id | diff --git a/tests/tck/features/go/SimpleCase.feature b/tests/tck/features/go/SimpleCase.feature index f09803a14c5..a58351e2068 100644 --- a/tests/tck/features/go/SimpleCase.feature +++ b/tests/tck/features/go/SimpleCase.feature @@ -310,7 +310,7 @@ Feature: Simple case | 0 | Start | | | When profiling query: """ - GO 1 to 3 STEP FROM "Tony Parker" OVER like WHERE $$.player.age > 40 YIELD DISTINCT id($$), $$.player.age as age, $$.player.name | ORDER BY $-.age + GO 1 to 3 STEPS FROM "Tony Parker" OVER like WHERE $$.player.age > 40 YIELD DISTINCT id($$), $$.player.age as age, $$.player.name | ORDER BY $-.age """ Then the result should be, in any order, with relax comparison: | id($$) | age | $$.player.name | @@ -452,7 +452,7 @@ Feature: Simple case | 0 | Start | | | When profiling query: """ - GO 1 STEP FROM "Tony Parker" OVER * YIELD distinct id($$) as id| GO 3 STEP FROM $-.id OVER * YIELD distinct id($$) | YIELD COUNT(*) + GO 1 STEPS FROM "Tony Parker" OVER * YIELD distinct id($$) as id| GO 3 STEPS FROM $-.id OVER * YIELD distinct id($$) | YIELD COUNT(*) """ Then the result should be, in any order, with relax comparison: | COUNT(*) | @@ -550,7 +550,7 @@ Feature: Simple case | 0 | Start | | | When profiling query: """ - GO 1 STEP FROM "Tony Parker" OVER like, serve REVERSELY WHERE id($$) != "Tim Duncan" YIELD DISTINCT id($$) | YIELD count(*) + GO 1 STEPS FROM "Tony Parker" OVER like, serve REVERSELY WHERE id($$) != "Tim Duncan" YIELD DISTINCT id($$) | YIELD count(*) """ Then the result should be, in any order, with relax comparison: | count(*) | @@ -592,7 +592,7 @@ Feature: Simple case | 0 | Start | | | When profiling query: """ - GO 1 to 3 STEP FROM "Tony Parker" OVER like WHERE id($$) != "Tim Duncan" YIELD DISTINCT id($$), $$.player.age as age, $$.player.name | ORDER BY $-.age + GO 1 to 3 STEPS FROM "Tony Parker" OVER like WHERE id($$) != "Tim Duncan" YIELD DISTINCT id($$), $$.player.age as age, $$.player.name | ORDER BY $-.age """ Then the result should be, in any order, with relax comparison: | id($$) | age | $$.player.name | @@ -618,7 +618,7 @@ Feature: Simple case | 0 | Start | | | When profiling query: """ - GO FROM "Yao Ming" OVER like YIELD DISTINCT id($$) AS aa | GO 1 to 3 STEP FROM $-.aa OVER like WHERE id($$) != "Tim Duncan" YIELD DISTINCT id($$), $$.player.age as age, $$.player.name | ORDER BY $-.age + GO FROM "Yao Ming" OVER like YIELD DISTINCT id($$) AS aa | GO 1 to 3 STEPS FROM $-.aa OVER like WHERE id($$) != "Tim Duncan" YIELD DISTINCT id($$), $$.player.age as age, $$.player.name | ORDER BY $-.age """ Then the result should be, in any order, with relax comparison: | id($$) | age | $$.player.name | diff --git a/tests/tck/features/insert/insertVertexOnly.feature b/tests/tck/features/insert/insertVertexOnly.feature index 4cf2b411912..a1807b31af5 100644 --- a/tests/tck/features/insert/insertVertexOnly.feature +++ b/tests/tck/features/insert/insertVertexOnly.feature @@ -28,7 +28,7 @@ Feature: insert vertex without tag Then the execution should be successful When executing query: """ - GO 2 STEP FROM 1 OVER e yield e._dst AS dst; + GO 2 STEPS FROM 1 OVER e yield e._dst AS dst; """ Then the result should be, in any order: | dst |