<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ydb/yql/essentials/sql/v1/complete/core, branch meta-1.0.3</title>
<subtitle>Mirror of YDB github repos</subtitle>
<id>https://code.mastervirt.ru/ydb/atom?h=meta-1.0.3</id>
<link rel='self' href='https://code.mastervirt.ru/ydb/atom?h=meta-1.0.3'/>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/'/>
<updated>2025-07-10T13:49:06Z</updated>
<entry>
<title>YQL-19747: Complete table functions</title>
<updated>2025-07-10T13:49:06Z</updated>
<author>
<name>vitya-smirnov</name>
<email>vitya-smirnov@yandex-team.com</email>
</author>
<published>2025-07-10T13:18:41Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/commit/?id=ab4a6f4beadc1b478f8c208d07226687821b5fc2'/>
<id>urn:sha1:ab4a6f4beadc1b478f8c208d07226687821b5fc2</id>
<content type='text'>
- Added table functions completion.

- Also fixed a bug when USEd cluster
  was not added to table context at table
  function argument.

- Complete folder names at `prefix`
  of `LIKE`, `RANGE`, etc.
commit_hash:26be383be728796e8431f906e2815acd77645ad4
</content>
</entry>
<entry>
<title>YQL-19747: Respect WITHOUT at schema synthesis</title>
<updated>2025-07-03T06:20:48Z</updated>
<author>
<name>vitya-smirnov</name>
<email>vitya-smirnov@yandex-team.com</email>
</author>
<published>2025-07-03T06:03:54Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/commit/?id=ca30a190eaf6cca92ab870e5147dad2c2b19339b'/>
<id>urn:sha1:ca30a190eaf6cca92ab870e5147dad2c2b19339b</id>
<content type='text'>
Also fixed a bug when the same table used with
and without an alias produced duplicated column
names. This is incorrect at translator, but anyway
we need to handle it gracefully. Also refactored
some utility methods like context union.
commit_hash:45a12675e865bb9d929e5e5178e16239a763d1f5
</content>
</entry>
<entry>
<title>YQL-19747: Fix self-join completion</title>
<updated>2025-06-25T08:58:48Z</updated>
<author>
<name>vitya-smirnov</name>
<email>vitya-smirnov@yandex-team.com</email>
</author>
<published>2025-06-25T08:16:34Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/commit/?id=4eb432c5aeea350c39ca2d2708b0e351dc31c42b'/>
<id>urn:sha1:4eb432c5aeea350c39ca2d2708b0e351dc31c42b</id>
<content type='text'>
Fixed a bug on self-join, as
table path was used as a key
to match columns with tables
instead of an alias.
commit_hash:0f9735a4c5ba0b2b88efc764bc5e7f5d41633fd8
</content>
</entry>
<entry>
<title>YQL-19747: Complete columns from JOIN</title>
<updated>2025-06-23T14:48:51Z</updated>
<author>
<name>vitya-smirnov</name>
<email>vitya-smirnov@yandex-team.com</email>
</author>
<published>2025-06-23T14:15:31Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/commit/?id=b4ef2d519178ae0e2cd3c5d30cbd5010c72014d2'/>
<id>urn:sha1:b4ef2d519178ae0e2cd3c5d30cbd5010c72014d2</id>
<content type='text'>
Collect tables with aliases during global
analysis and send a multiple requests
to a schema provider.
commit_hash:51cbc40cee6cda09d5bfe256a0425e7c809c04f5
</content>
</entry>
<entry>
<title>YQL-19747: Support table aliases</title>
<updated>2025-06-18T14:40:32Z</updated>
<author>
<name>vitya-smirnov</name>
<email>vitya-smirnov@yandex-team.com</email>
</author>
<published>2025-06-18T14:03:59Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/commit/?id=0ac6c9eac8c5c9d71141af3c89f7cfc1b66a279e'/>
<id>urn:sha1:0ac6c9eac8c5c9d71141af3c89f7cfc1b66a279e</id>
<content type='text'>
commit_hash:6d67ec1fa5023083debd89aaa99950019ca37c90
</content>
</entry>
<entry>
<title>YQL-19747: Complete columns at simple select</title>
<updated>2025-06-17T10:12:27Z</updated>
<author>
<name>vitya-smirnov</name>
<email>vitya-smirnov@yandex-team.com</email>
</author>
<published>2025-06-17T09:45:20Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/commit/?id=633ab50dd51d6f17810f71559ccf6e5bfebe2044'/>
<id>urn:sha1:633ab50dd51d6f17810f71559ccf6e5bfebe2044</id>
<content type='text'>
Added support for a columns completion at a simple select. For example, `` SELECT # FROM hahn.`home/yql/tutorial/users` `` и `` USE hahn; SELECT $ FROM `home/yql/tutorial/users` ``.
commit_hash:2254449e91255c19792a1dc521825e44dda7d63b
</content>
</entry>
<entry>
<title>YQL-19747: Support immediate string named expressions</title>
<updated>2025-05-27T09:09:17Z</updated>
<author>
<name>vityaman</name>
<email>vityaman.dev@yandex.ru</email>
</author>
<published>2025-05-27T08:56:16Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/commit/?id=04c43eb2d8297ffe7b7b7a5b4ca48980d01fca96'/>
<id>urn:sha1:04c43eb2d8297ffe7b7b7a5b4ca48980d01fca96</id>
<content type='text'>
---
- Related to `YQL-19747`
- Related to https://github.com/vityaman/ydb/issues/50

---

Pull Request resolved: https://github.com/ytsaurus/ytsaurus/pull/1292
commit_hash:a6d543bc18b2f9239bf0b33afd8497a7919fe4b3
</content>
</entry>
<entry>
<title>YQL-19747: Recover from unclosed ID_QUOTED</title>
<updated>2025-05-20T10:23:38Z</updated>
<author>
<name>vityaman</name>
<email>vityaman.dev@yandex.ru</email>
</author>
<published>2025-05-20T10:09:37Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/commit/?id=ae913bccb4fd8a8ba5f536c8afe622e2ad229fbc'/>
<id>urn:sha1:ae913bccb4fd8a8ba5f536c8afe622e2ad229fbc</id>
<content type='text'>
The simplest solution actually is an SQL injection.

---

- Related to `YQL-19747`
- Related to https://github.com/ydb-platform/ydb/issues/9056
- Related to https://github.com/ydb-platform/ydb/pull/18146
- Related to https://github.com/vityaman/ydb/issues/46

---

Pull Request resolved: https://github.com/ytsaurus/ytsaurus/pull/1283
commit_hash:7043e7cdd1e0d378926783d31cf5f8e055393aaa
</content>
</entry>
<entry>
<title>YQL-19747 Complete folder, table and cluster names</title>
<updated>2025-05-06T13:04:08Z</updated>
<author>
<name>vityaman</name>
<email>vityaman.dev@yandex.ru</email>
</author>
<published>2025-05-06T12:49:02Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/commit/?id=9c3fdca51d8ae892c5ad8f6ef92df73fafc09e28'/>
<id>urn:sha1:9c3fdca51d8ae892c5ad8f6ef92df73fafc09e28</id>
<content type='text'>
---

- Related to `YQL-19747`
- On top of https://github.com/ytsaurus/ytsaurus/pull/1253
- Related to https://github.com/ydb-platform/ydb/issues/9056
- Related to https://github.com/vityaman/ydb/issues/14
- Related to https://github.com/vityaman/ydb/issues/35
- Related to https://github.com/vityaman/ydb/issues/40

---

Pull Request resolved: https://github.com/ytsaurus/ytsaurus/pull/1257
commit_hash:0b842abb27184c88b8177beeea29fb1ea86b7a04
</content>
</entry>
<entry>
<title>YQL-19747 Detect a token at the caret position</title>
<updated>2025-04-23T12:27:38Z</updated>
<author>
<name>vityaman</name>
<email>vityaman.dev@yandex.ru</email>
</author>
<published>2025-04-23T12:04:48Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/commit/?id=c222f6f103376934dd705e16bf9a3bad66e44365'/>
<id>urn:sha1:c222f6f103376934dd705e16bf9a3bad66e44365</id>
<content type='text'>
When I tried to implement a folder and object names completion at `ID_QUOTED` I faced with a problem, that I actually can't detect, that cursor is at `ID_QUOTED` token because `TCompletionInput::Text` it was cut until the `TCompletionInput::CursorPosition`, therefore at input ``` SELECT * FROM `#` ``` prefix was ``` SELECT * FROM `# ``` and then lexer failed.

While we actually want tokenize the whole current statement, `C3` still needs to receive a prefix as input. I tried to tokenize the whole statement and then on input `SELECT Optional&lt;#&gt;` got nothing because `&lt;&gt;` is solid token in the `SQL`. The only way to fix it I found is to cut a query to prefix until the cursor position.

BTW, current implementation is not so efficient as we tokenize the input multiple times. Especially `SplitQueryToStatemnts` seems heavy. In future we anyway will parse the whole input so will need to design APIs to receive ready token streams to do statements splitting, for example, just not to do the work twice.

![image](https://github.com/user-attachments/assets/114804d3-f311-4a46-be84-8ed4650bc9dd)

So I introduce you the following changes

- [x] Select the whole current statement, not just prefix.
- [x] Find the token at caret and output no candidates when caret is at `STRING_VALUE`, `DIGIGTS` and so on.
- [x] Change `C3` wrapper interface to take `TCompletionInput` to hide an implementation detail that it runs on cut prefix.
- [x] `#` annotated queries in unit tests.
- [x] Detect `CaretTokenPosition` -- if is it enclosed with a token or between two.
- [x] Ensure that `maxErrors` in `ILexer::Tokenize` is positive. Just a tiny bugfix.

---

- Related to https://github.com/ytsaurus/ytsaurus/pull/1209
- Related to https://github.com/ydb-platform/ydb/issues/9056
- Related to https://github.com/vityaman/ydb/issues/14

---

Pull Request resolved: https://github.com/ytsaurus/ytsaurus/pull/1225
commit_hash:a434b9888ec8a7356247d63d9f1420e256ae4fca
</content>
</entry>
</feed>
