From 7a3d5a7e21bb3135ece899a2f91e57dc591e4331 Mon Sep 17 00:00:00 2001 From: Aleksey Myasnikov Date: Fri, 22 Nov 2024 12:35:33 +0300 Subject: [PATCH 01/13] Enabled by default enable_antlr4_parser feature-flag for local-ydb docker image --- ydb/tests/library/harness/resources/default_yaml.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/ydb/tests/library/harness/resources/default_yaml.yml b/ydb/tests/library/harness/resources/default_yaml.yml index 7863c25ba50a..1853ceac608a 100644 --- a/ydb/tests/library/harness/resources/default_yaml.yml +++ b/ydb/tests/library/harness/resources/default_yaml.yml @@ -160,6 +160,7 @@ feature_flags: enable_persistent_query_stats: true enable_scheme_transactions_at_scheme_shard: true enable_mvcc_snapshot_reads: true + enable_antlr4_parser: true kqpconfig: settings: - name: "_ResultRowsLimit" From 3e3154e280557d60fb81dc606596b4d97cea8634 Mon Sep 17 00:00:00 2001 From: Aleksey Myasnikov Date: Mon, 25 Nov 2024 17:20:05 +0300 Subject: [PATCH 02/13] Update test_ydb_over_fq.py --- ydb/tests/fq/s3/test_ydb_over_fq.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ydb/tests/fq/s3/test_ydb_over_fq.py b/ydb/tests/fq/s3/test_ydb_over_fq.py index 571b352acc42..37ee32976a7a 100644 --- a/ydb/tests/fq/s3/test_ydb_over_fq.py +++ b/ydb/tests/fq/s3/test_ydb_over_fq.py @@ -292,7 +292,7 @@ def test_execute_data_query_error(self, kikimr, s3, client, unique_prefix, yq_ve with session.transaction() as tx: assert_that( calling(tx.execute).with_args("BAD QUERY"), - raises(ydb.issues.InternalError, "Unexpected token .* : cannot match to any predicted input"), + raises(ydb.issues.InternalError, "mismatched input .* expecting .*"), ) with session.transaction() as tx: query = "select * from {}{}".format("bindings." if yq_version == "v1" else "", "WRONG_BIND") From 2c3821809a5644a347b889ee665aecffe78831ce Mon Sep 17 00:00:00 2001 From: Aleksey Myasnikov Date: Mon, 25 Nov 2024 17:25:05 +0300 Subject: [PATCH 03/13] Update test_select_1.py --- ydb/tests/fq/yds/test_select_1.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ydb/tests/fq/yds/test_select_1.py b/ydb/tests/fq/yds/test_select_1.py index 782b84bcd1a5..477f806e3f77 100644 --- a/ydb/tests/fq/yds/test_select_1.py +++ b/ydb/tests/fq/yds/test_select_1.py @@ -118,7 +118,7 @@ def test_compile_error(self, client, yq_version): assert ( "Query failed with code " + ("ABORTED" if yq_version == "v1" else "GENERIC_ERROR") in describe_string ), describe_string - assert "Unexpected token" in describe_string, describe_string + assert "extraneous input" in describe_string, describe_string # Failed to parse query is added in YQv1 only if yq_version == "v1": assert "Failed to parse query" in describe_string, describe_string From 2c1fc112823ce7583f289ca04c6c4e180ba02b49 Mon Sep 17 00:00:00 2001 From: Aleksey Myasnikov Date: Tue, 26 Nov 2024 06:57:38 +0300 Subject: [PATCH 04/13] Update test_ydb_over_fq.py --- ydb/tests/fq/s3/test_ydb_over_fq.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ydb/tests/fq/s3/test_ydb_over_fq.py b/ydb/tests/fq/s3/test_ydb_over_fq.py index 37ee32976a7a..7d27df75a31d 100644 --- a/ydb/tests/fq/s3/test_ydb_over_fq.py +++ b/ydb/tests/fq/s3/test_ydb_over_fq.py @@ -292,7 +292,7 @@ def test_execute_data_query_error(self, kikimr, s3, client, unique_prefix, yq_ve with session.transaction() as tx: assert_that( calling(tx.execute).with_args("BAD QUERY"), - raises(ydb.issues.InternalError, "mismatched input .* expecting .*"), + raises(ydb.issues.InternalError, "Failed to parse query"), ) with session.transaction() as tx: query = "select * from {}{}".format("bindings." if yq_version == "v1" else "", "WRONG_BIND") From f690fad7e1a749f4129051ed927e3161c412e759 Mon Sep 17 00:00:00 2001 From: Aleksey Myasnikov Date: Tue, 26 Nov 2024 07:00:59 +0300 Subject: [PATCH 05/13] Update test_ydb_over_fq.py --- ydb/tests/fq/s3/test_ydb_over_fq.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ydb/tests/fq/s3/test_ydb_over_fq.py b/ydb/tests/fq/s3/test_ydb_over_fq.py index 7d27df75a31d..a8683fedb6e4 100644 --- a/ydb/tests/fq/s3/test_ydb_over_fq.py +++ b/ydb/tests/fq/s3/test_ydb_over_fq.py @@ -292,7 +292,7 @@ def test_execute_data_query_error(self, kikimr, s3, client, unique_prefix, yq_ve with session.transaction() as tx: assert_that( calling(tx.execute).with_args("BAD QUERY"), - raises(ydb.issues.InternalError, "Failed to parse query"), + raises(ydb.issues.InternalError, "Unexpected token 'BAD' : cannot match to any predicted input..."), ) with session.transaction() as tx: query = "select * from {}{}".format("bindings." if yq_version == "v1" else "", "WRONG_BIND") From 80f4224250a639da9a28d9b7baa16f4672476966 Mon Sep 17 00:00:00 2001 From: Aleksey Myasnikov Date: Tue, 26 Nov 2024 07:02:49 +0300 Subject: [PATCH 06/13] Update test_select_1.py --- ydb/tests/fq/yds/test_select_1.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ydb/tests/fq/yds/test_select_1.py b/ydb/tests/fq/yds/test_select_1.py index 477f806e3f77..b704de0c8a47 100644 --- a/ydb/tests/fq/yds/test_select_1.py +++ b/ydb/tests/fq/yds/test_select_1.py @@ -118,7 +118,7 @@ def test_compile_error(self, client, yq_version): assert ( "Query failed with code " + ("ABORTED" if yq_version == "v1" else "GENERIC_ERROR") in describe_string ), describe_string - assert "extraneous input" in describe_string, describe_string + assert "Unexpected token \'SUPERSELECT\' : cannot match to any predicted input..." in describe_string, describe_string # Failed to parse query is added in YQv1 only if yq_version == "v1": assert "Failed to parse query" in describe_string, describe_string From dbb83239a908539d07b43edcb14986d7bb4815f1 Mon Sep 17 00:00:00 2001 From: Aleksey Myasnikov Date: Tue, 26 Nov 2024 07:03:30 +0300 Subject: [PATCH 07/13] Update test_ydb_over_fq.py --- ydb/tests/fq/s3/test_ydb_over_fq.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ydb/tests/fq/s3/test_ydb_over_fq.py b/ydb/tests/fq/s3/test_ydb_over_fq.py index a8683fedb6e4..211a9e44c2f6 100644 --- a/ydb/tests/fq/s3/test_ydb_over_fq.py +++ b/ydb/tests/fq/s3/test_ydb_over_fq.py @@ -292,7 +292,7 @@ def test_execute_data_query_error(self, kikimr, s3, client, unique_prefix, yq_ve with session.transaction() as tx: assert_that( calling(tx.execute).with_args("BAD QUERY"), - raises(ydb.issues.InternalError, "Unexpected token 'BAD' : cannot match to any predicted input..."), + raises(ydb.issues.InternalError, "Unexpected token \'BAD\' : cannot match to any predicted input..."), ) with session.transaction() as tx: query = "select * from {}{}".format("bindings." if yq_version == "v1" else "", "WRONG_BIND") From 8d401913cdc22661e4ad24f2e5727759588c3cd9 Mon Sep 17 00:00:00 2001 From: Aleksey Myasnikov Date: Fri, 6 Dec 2024 15:24:37 +0300 Subject: [PATCH 08/13] Update test_ydb_over_fq.py --- ydb/tests/fq/s3/test_ydb_over_fq.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ydb/tests/fq/s3/test_ydb_over_fq.py b/ydb/tests/fq/s3/test_ydb_over_fq.py index 211a9e44c2f6..a8683fedb6e4 100644 --- a/ydb/tests/fq/s3/test_ydb_over_fq.py +++ b/ydb/tests/fq/s3/test_ydb_over_fq.py @@ -292,7 +292,7 @@ def test_execute_data_query_error(self, kikimr, s3, client, unique_prefix, yq_ve with session.transaction() as tx: assert_that( calling(tx.execute).with_args("BAD QUERY"), - raises(ydb.issues.InternalError, "Unexpected token \'BAD\' : cannot match to any predicted input..."), + raises(ydb.issues.InternalError, "Unexpected token 'BAD' : cannot match to any predicted input..."), ) with session.transaction() as tx: query = "select * from {}{}".format("bindings." if yq_version == "v1" else "", "WRONG_BIND") From 1a72362149482a8b0246c993e594c1b3abe038b4 Mon Sep 17 00:00:00 2001 From: Aleksey Myasnikov Date: Fri, 6 Dec 2024 15:25:59 +0300 Subject: [PATCH 09/13] Apply suggestions from code review --- ydb/tests/fq/yds/test_select_1.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ydb/tests/fq/yds/test_select_1.py b/ydb/tests/fq/yds/test_select_1.py index b704de0c8a47..8b93c019108f 100644 --- a/ydb/tests/fq/yds/test_select_1.py +++ b/ydb/tests/fq/yds/test_select_1.py @@ -118,7 +118,7 @@ def test_compile_error(self, client, yq_version): assert ( "Query failed with code " + ("ABORTED" if yq_version == "v1" else "GENERIC_ERROR") in describe_string ), describe_string - assert "Unexpected token \'SUPERSELECT\' : cannot match to any predicted input..." in describe_string, describe_string + assert "Unexpected token 'SUPERSELECT' : cannot match to any predicted input..." in describe_string, describe_string # Failed to parse query is added in YQv1 only if yq_version == "v1": assert "Failed to parse query" in describe_string, describe_string From 92aa3528c81250d9f3beb9f5deb55b9455ef2478 Mon Sep 17 00:00:00 2001 From: Aleksey Myasnikov Date: Fri, 6 Dec 2024 15:26:54 +0300 Subject: [PATCH 10/13] Apply suggestions from code review --- ydb/tests/fq/s3/test_ydb_over_fq.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ydb/tests/fq/s3/test_ydb_over_fq.py b/ydb/tests/fq/s3/test_ydb_over_fq.py index a8683fedb6e4..571b352acc42 100644 --- a/ydb/tests/fq/s3/test_ydb_over_fq.py +++ b/ydb/tests/fq/s3/test_ydb_over_fq.py @@ -292,7 +292,7 @@ def test_execute_data_query_error(self, kikimr, s3, client, unique_prefix, yq_ve with session.transaction() as tx: assert_that( calling(tx.execute).with_args("BAD QUERY"), - raises(ydb.issues.InternalError, "Unexpected token 'BAD' : cannot match to any predicted input..."), + raises(ydb.issues.InternalError, "Unexpected token .* : cannot match to any predicted input"), ) with session.transaction() as tx: query = "select * from {}{}".format("bindings." if yq_version == "v1" else "", "WRONG_BIND") From 582265fd8de876c7b9fb8e8d99f0e0cdf5b9c44b Mon Sep 17 00:00:00 2001 From: Aleksey Myasnikov Date: Fri, 6 Dec 2024 15:27:15 +0300 Subject: [PATCH 11/13] Apply suggestions from code review --- ydb/tests/fq/yds/test_select_1.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ydb/tests/fq/yds/test_select_1.py b/ydb/tests/fq/yds/test_select_1.py index 8b93c019108f..782b84bcd1a5 100644 --- a/ydb/tests/fq/yds/test_select_1.py +++ b/ydb/tests/fq/yds/test_select_1.py @@ -118,7 +118,7 @@ def test_compile_error(self, client, yq_version): assert ( "Query failed with code " + ("ABORTED" if yq_version == "v1" else "GENERIC_ERROR") in describe_string ), describe_string - assert "Unexpected token 'SUPERSELECT' : cannot match to any predicted input..." in describe_string, describe_string + assert "Unexpected token" in describe_string, describe_string # Failed to parse query is added in YQv1 only if yq_version == "v1": assert "Failed to parse query" in describe_string, describe_string From 36f974328dd638577667945778da914baffcc532 Mon Sep 17 00:00:00 2001 From: Aleksey Myasnikov Date: Tue, 17 Dec 2024 21:41:27 +0300 Subject: [PATCH 12/13] Update test_ydb_over_fq.py --- ydb/tests/fq/s3/test_ydb_over_fq.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ydb/tests/fq/s3/test_ydb_over_fq.py b/ydb/tests/fq/s3/test_ydb_over_fq.py index 571b352acc42..33c07cbdf2d1 100644 --- a/ydb/tests/fq/s3/test_ydb_over_fq.py +++ b/ydb/tests/fq/s3/test_ydb_over_fq.py @@ -292,7 +292,7 @@ def test_execute_data_query_error(self, kikimr, s3, client, unique_prefix, yq_ve with session.transaction() as tx: assert_that( calling(tx.execute).with_args("BAD QUERY"), - raises(ydb.issues.InternalError, "Unexpected token .* : cannot match to any predicted input"), + raises(ydb.issues.InternalError, "mismatched input .* expecting"), ) with session.transaction() as tx: query = "select * from {}{}".format("bindings." if yq_version == "v1" else "", "WRONG_BIND") From 161bd2088dfb5a9bcbd5ce248b2bc90833179091 Mon Sep 17 00:00:00 2001 From: Aleksey Myasnikov Date: Tue, 17 Dec 2024 21:44:06 +0300 Subject: [PATCH 13/13] Update test_select_1.py --- ydb/tests/fq/yds/test_select_1.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ydb/tests/fq/yds/test_select_1.py b/ydb/tests/fq/yds/test_select_1.py index 782b84bcd1a5..477f806e3f77 100644 --- a/ydb/tests/fq/yds/test_select_1.py +++ b/ydb/tests/fq/yds/test_select_1.py @@ -118,7 +118,7 @@ def test_compile_error(self, client, yq_version): assert ( "Query failed with code " + ("ABORTED" if yq_version == "v1" else "GENERIC_ERROR") in describe_string ), describe_string - assert "Unexpected token" in describe_string, describe_string + assert "extraneous input" in describe_string, describe_string # Failed to parse query is added in YQv1 only if yq_version == "v1": assert "Failed to parse query" in describe_string, describe_string