diff options
author | vityaman <[email protected]> | 2025-05-27 22:51:59 +0300 |
---|---|---|
committer | robot-piglet <[email protected]> | 2025-05-27 23:07:28 +0300 |
commit | cc7006763c2335afaed9b76e4273339f91ed43cc (patch) | |
tree | 7cf9793ec693d35746c996dfad3dd7906aba30b8 /yql/essentials/sql/v1/complete/sql_complete_ut.cpp | |
parent | 602c57938d4cc2b047646bae209f1d1420a22d68 (diff) |
YQL-19747: Fix cluster provider interpretation
There was a mistake thinking that provider is a part of a cluster name. Actually `yt:saurus` and `saurus` are same clusters and provider (`yt`) serves only as a hint for translation expressions such as `yt:$cluster_name`.
---
- Related to `YQL-19747`
- Related to https://github.com/vityaman/ydb/issues/54
- Related to https://github.com/ydb-platform/ydb/issues/9056
---
Pull Request resolved: https://github.com/ytsaurus/ytsaurus/pull/1301
commit_hash:19a45cf0bb6c7dda26747b2e3371646272f79bce
Diffstat (limited to 'yql/essentials/sql/v1/complete/sql_complete_ut.cpp')
-rw-r--r-- | yql/essentials/sql/v1/complete/sql_complete_ut.cpp | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/yql/essentials/sql/v1/complete/sql_complete_ut.cpp b/yql/essentials/sql/v1/complete/sql_complete_ut.cpp index 60a77a422d9..04099f911b9 100644 --- a/yql/essentials/sql/v1/complete/sql_complete_ut.cpp +++ b/yql/essentials/sql/v1/complete/sql_complete_ut.cpp @@ -95,7 +95,7 @@ Y_UNIT_TEST_SUITE(SqlCompleteTests) { {{"/", {{"Table", "people"}, {"Folder", "yql"}}}, {"/yql/", {{"Table", "tutorial"}}}}}, - {"yt:saurus", + {"saurus", {{"/", {{"Table", "maxim"}}}}}, }; @@ -190,7 +190,7 @@ Y_UNIT_TEST_SUITE(SqlCompleteTests) { Y_UNIT_TEST(Use) { TVector<TCandidate> expected = { {ClusterName, "example"}, - {ClusterName, "yt:saurus"}, + {ClusterName, "saurus"}, }; auto engine = MakeSqlCompletionEngineUT(); UNIT_ASSERT_VALUES_EQUAL(Complete(engine, "USE "), expected); @@ -202,7 +202,7 @@ Y_UNIT_TEST_SUITE(SqlCompleteTests) { TVector<TCandidate> expected = { {TableName, "`maxim`"}, {ClusterName, "example"}, - {ClusterName, "yt:saurus"}, + {ClusterName, "saurus"}, {Keyword, "ANY"}, }; UNIT_ASSERT_VALUES_EQUAL( @@ -219,7 +219,7 @@ Y_UNIT_TEST_SUITE(SqlCompleteTests) { {FolderName, "`prod/`"}, {FolderName, "`test/`"}, {ClusterName, "example"}, - {ClusterName, "yt:saurus"}, + {ClusterName, "saurus"}, {Keyword, "ANY"}, }; UNIT_ASSERT_VALUES_EQUAL( @@ -284,7 +284,7 @@ Y_UNIT_TEST_SUITE(SqlCompleteTests) { {FolderName, "`prod/`"}, {FolderName, "`test/`"}, {ClusterName, "example"}, - {ClusterName, "yt:saurus"}, + {ClusterName, "saurus"}, {Keyword, "IF NOT EXISTS"}, }; UNIT_ASSERT_VALUES_EQUAL(Complete(engine, "CREATE TABLE #"), expected); @@ -333,7 +333,7 @@ Y_UNIT_TEST_SUITE(SqlCompleteTests) { {FolderName, "`prod/`"}, {FolderName, "`test/`"}, {ClusterName, "example"}, - {ClusterName, "yt:saurus"}, + {ClusterName, "saurus"}, {Keyword, "IF EXISTS"}, }; auto engine = MakeSqlCompletionEngineUT(); @@ -529,7 +529,7 @@ Y_UNIT_TEST_SUITE(SqlCompleteTests) { {FolderName, "`prod/`"}, {FolderName, "`test/`"}, {ClusterName, "example"}, - {ClusterName, "yt:saurus"}, + {ClusterName, "saurus"}, {Keyword, "ANY"}, }; UNIT_ASSERT_VALUES_EQUAL(Complete(engine, "SELECT * FROM "), expected); @@ -629,12 +629,7 @@ Y_UNIT_TEST_SUITE(SqlCompleteTests) { auto engine = MakeSqlCompletionEngineUT(); { TVector<TCandidate> expected = { - {ClusterName, "yt:saurus"}, - }; - UNIT_ASSERT_VALUES_EQUAL(Complete(engine, "SELECT * FROM yt#"), expected); - } - { - TVector<TCandidate> expected = { + {ClusterName, "example"}, {ClusterName, "saurus"}, }; UNIT_ASSERT_VALUES_EQUAL(Complete(engine, "SELECT * FROM yt:"), expected); @@ -671,7 +666,7 @@ Y_UNIT_TEST_SUITE(SqlCompleteTests) { TVector<TCandidate> expected = { {TableName, "`maxim`"}, {ClusterName, "example"}, - {ClusterName, "yt:saurus"}, + {ClusterName, "saurus"}, {Keyword, "ANY"}, }; UNIT_ASSERT_VALUES_EQUAL(Complete(engine, "USE yt:saurus; SELECT * FROM "), expected); @@ -687,7 +682,7 @@ Y_UNIT_TEST_SUITE(SqlCompleteTests) { TVector<TCandidate> expected = { {TableName, "`maxim`"}, {ClusterName, "example"}, - {ClusterName, "yt:saurus"}, + {ClusterName, "saurus"}, {Keyword, "ANY"}, }; UNIT_ASSERT_VALUES_EQUAL(Complete(engine, "USE example; USE yt:saurus; SELECT * FROM "), expected); @@ -696,7 +691,7 @@ Y_UNIT_TEST_SUITE(SqlCompleteTests) { TVector<TCandidate> expected = { {TableName, "`maxim`"}, {ClusterName, "example"}, - {ClusterName, "yt:saurus"}, + {ClusterName, "saurus"}, {Keyword, "ANY"}, }; UNIT_ASSERT_VALUES_EQUAL(Complete(engine, R"( @@ -712,7 +707,7 @@ Y_UNIT_TEST_SUITE(SqlCompleteTests) { {TableName, "`people`"}, {FolderName, "`yql/`"}, {ClusterName, "example"}, - {ClusterName, "yt:saurus"}, + {ClusterName, "saurus"}, {Keyword, "ANY"}, }; UNIT_ASSERT_VALUES_EQUAL(Complete(engine, R"( @@ -786,7 +781,7 @@ Y_UNIT_TEST_SUITE(SqlCompleteTests) { {FolderName, "`prod/`"}, {FolderName, "`test/`"}, {ClusterName, "example"}, - {ClusterName, "yt:saurus"}, + {ClusterName, "saurus"}, }; UNIT_ASSERT_VALUES_EQUAL(Complete(engine, "UPSERT INTO "), expected); } |