diff options
author | vityaman <[email protected]> | 2025-05-12 20:47:40 +0300 |
---|---|---|
committer | robot-piglet <[email protected]> | 2025-05-12 21:00:51 +0300 |
commit | b336ad5ec16dd1f541c55b7944fc9e6b5bba57a2 (patch) | |
tree | 4c08e2292888f6ad429ea645b38c0cb1cdb37f2e /yql/essentials/sql/v1/complete/sql_complete_ut.cpp | |
parent | c057c2354db18cf0f616100db4b8e39b146d06eb (diff) |
YQL-19747: Fix caret token position
Outcomes:
1. Need to think more deeply about library interfaces. If you think that an interface is redundant, think again, because author knows a usecase that you do not imagine.
2. If you are lazy now to implement something robustly, think twice because the day will come and this code
will fire.
The problem was that on input ``` ... cluster.`/yql/t#` ``` C3 receives only a prefix ``` ... cluster.`/yql/t ``` and a token stream produced was incorrect and therefore completions too.
---
- Related to `YQL-19747`
- Related to https://github.com/ytsaurus/ytsaurus/pull/1257
- Related to https://github.com/ydb-platform/ydb/issues/9056
---
Pull Request resolved: https://github.com/ytsaurus/ytsaurus/pull/1271
commit_hash:8bf5f2683c9e41963003da923f255f63b898aac5
Diffstat (limited to 'yql/essentials/sql/v1/complete/sql_complete_ut.cpp')
-rw-r--r-- | yql/essentials/sql/v1/complete/sql_complete_ut.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/yql/essentials/sql/v1/complete/sql_complete_ut.cpp b/yql/essentials/sql/v1/complete/sql_complete_ut.cpp index a72446779cf..10afd08f827 100644 --- a/yql/essentials/sql/v1/complete/sql_complete_ut.cpp +++ b/yql/essentials/sql/v1/complete/sql_complete_ut.cpp @@ -91,7 +91,9 @@ Y_UNIT_TEST_SUITE(SqlCompleteTests) { {"/test/service/", {{"Table", "example"}}}, {"/.sys/", {{"Table", "status"}}}}}, {"example", - {{"/", {{"Table", "people"}}}}}, + {{"/", {{"Table", "people"}, + {"Folder", "yql"}}}, + {"/yql/", {{"Table", "tutorial"}}}}}, {"yt:saurus", {{"/", {{"Table", "maxim"}}}}}, }; @@ -609,6 +611,12 @@ Y_UNIT_TEST_SUITE(SqlCompleteTests) { }; UNIT_ASSERT_VALUES_EQUAL(CompleteTop(1, engine, "SELECT * FROM example."), expected); } + { + TVector<TCandidate> expected = { + {TableName, "tutorial"}, + }; + UNIT_ASSERT_VALUES_EQUAL(CompleteTop(1, engine, "SELECT * FROM example.`/yql/t#`"), expected); + } } Y_UNIT_TEST(SelectWhere) { |