<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ydb/yql/essentials/sql/v1/complete/sql_complete_ut.cpp, branch CLI_2.21.0</title>
<subtitle>Mirror of YDB github repos</subtitle>
<id>https://code.mastervirt.ru/ydb/atom?h=CLI_2.21.0</id>
<link rel='self' href='https://code.mastervirt.ru/ydb/atom?h=CLI_2.21.0'/>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/'/>
<updated>2025-05-20T10:23:38Z</updated>
<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: Support USE statement</title>
<updated>2025-05-20T10:07:06Z</updated>
<author>
<name>vityaman</name>
<email>vityaman.dev@yandex.ru</email>
</author>
<published>2025-05-20T09:50:28Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/commit/?id=16630d4dfad772e0108e694f76f922e486cd6439'/>
<id>urn:sha1:16630d4dfad772e0108e694f76f922e486cd6439</id>
<content type='text'>
Introduce global analysis which will be extended with more ParseTree analysis later.

---

- Related to `YQL-19747`
- Related to https://github.com/vityaman/ydb/issues/40

---

Pull Request resolved: https://github.com/ytsaurus/ytsaurus/pull/1281
commit_hash:848fb3fdd6bc9612769c47d66198fca018ff465f
</content>
</entry>
<entry>
<title>YQL-19747: Fix unquoted object path completion</title>
<updated>2025-05-19T14:51:48Z</updated>
<author>
<name>vityaman</name>
<email>vityaman.dev@yandex.ru</email>
</author>
<published>2025-05-19T14:36:10Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/commit/?id=f16ede95953f8cdd44e3b762b175bd22e106bb5c'/>
<id>urn:sha1:f16ede95953f8cdd44e3b762b175bd22e106bb5c</id>
<content type='text'>
On `SELECT * FROM pn` it completed to `SELECT * FROM ppnv1`, but expected ``` SELECT * FROM `pnv1` ```.

---

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

---

Pull Request resolved: https://github.com/ytsaurus/ytsaurus/pull/1280
commit_hash:e937239fae7bf609bde6358b9b27c2b504c8ba32
</content>
</entry>
<entry>
<title>YQL-19747: Ignore type_id completions and table_key</title>
<updated>2025-05-16T12:32:43Z</updated>
<author>
<name>vityaman</name>
<email>vityaman.dev@yandex.ru</email>
</author>
<published>2025-05-16T12:20:12Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/commit/?id=31441fb3a8e27eb1c9f1125b55dd4a83d9310fc0'/>
<id>urn:sha1:31441fb3a8e27eb1c9f1125b55dd4a83d9310fc0</id>
<content type='text'>
Fixes superfluous candidates (`OPTIONAL`, `CALLABLE`, ...) at `SELECT * FROM #`.

---

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

---

Pull Request resolved: https://github.com/ytsaurus/ytsaurus/pull/1273
commit_hash:d34d81ea86b8b6b5d339174be20d14d0371c3de6
</content>
</entry>
<entry>
<title>YQL-19747: Complete camel case type names</title>
<updated>2025-05-12T18:16:38Z</updated>
<author>
<name>vityaman</name>
<email>vityaman.dev@yandex.ru</email>
</author>
<published>2025-05-12T18:05:25Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/commit/?id=53b15a5b87b078a27ee071b8ab93458f1a3bcd81'/>
<id>urn:sha1:53b15a5b87b078a27ee071b8ab93458f1a3bcd81</id>
<content type='text'>
---

- Related to `YQL-19747`
- Related to https://github.com/vityaman/ydb/issues/8

---

Pull Request resolved: https://github.com/ytsaurus/ytsaurus/pull/1268
commit_hash:76e4e2c8b225994cc842c1ee00a0ec8e6eed5c05
</content>
</entry>
<entry>
<title>YQL-19747: Fix caret token position</title>
<updated>2025-05-12T18:00:51Z</updated>
<author>
<name>vityaman</name>
<email>vityaman.dev@yandex.ru</email>
</author>
<published>2025-05-12T17:47:40Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/commit/?id=b336ad5ec16dd1f541c55b7944fc9e6b5bba57a2'/>
<id>urn:sha1:b336ad5ec16dd1f541c55b7944fc9e6b5bba57a2</id>
<content type='text'>
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
</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 Fallback on failing NormalizeName</title>
<updated>2025-04-30T17:38:23Z</updated>
<author>
<name>vityaman</name>
<email>vityaman.dev@yandex.ru</email>
</author>
<published>2025-04-30T17:05:26Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/commit/?id=427876cf6cdf8ed43bed803d8338044a08213657'/>
<id>urn:sha1:427876cf6cdf8ed43bed803d8338044a08213657</id>
<content type='text'>
We faced with a failing assertion at `NYql::NormalizeName`. This patch expects it and fallbacks to `ToLowerUTF8`.

---

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

---

Pull Request resolved: https://github.com/ytsaurus/ytsaurus/pull/1255
commit_hash:946162904ce3b74f490debb7f9e0587f136b4075
</content>
</entry>
<entry>
<title>YQL-19747 Introduce Union and split Static NameServices</title>
<updated>2025-04-30T10:22:03Z</updated>
<author>
<name>vityaman</name>
<email>vityaman.dev@yandex.ru</email>
</author>
<published>2025-04-30T09:58:42Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/commit/?id=92d6162267a49773e5f40d0a0130edf6ca27624b'/>
<id>urn:sha1:92d6162267a49773e5f40d0a0130edf6ca27624b</id>
<content type='text'>
Essentially we need the `UnionNameService` to integrate dynamic name services into the `sql/v1/complete`. This decorator queries multiple name services and merges their responses. We will use it to union static `NameServices` and the `SchemaNameService` (and the `ClusterNameService`, and so on).

It does not deal with exceptions and fails the whole request on some subtask failed. Client should prepare robust children (later `SwallowingNameService` will be added to return an empty `NameResponse` on errors to provide best-effort dynamic object loading).

`StaticNameService` was split into micro-`NameService`s :)

`NameConstraints` are extracted to provide name qualification via `Qualified` and `Unqualified` methods. This is needed because depending on a context `NameService` can return unqualified names (for example, on `PRAGMA yt.#`). As internal indexes for scanning and ranking are built on a sorted list of, then `Ranking` actually needs an ability to get fully-qualified names, so now it via the `NameConstraints`.

Also this design potentially let us to improve internal indexes by using partitioning by a namespace. Other option was to make `PragmaName` and `FunctionName` more structured via adding a separate field for a namespace, but it seems to me that it will force to do more parsing from indexes results to a `Name`. Anyway this is an internal component so it can be changed if needed.  I still doubt this decision because structured `PragmaName { Namespace, Identifier }` seems to be cleaner and there should be no noticeable overhead because of COW strings.

---

Pull Request resolved: https://github.com/ytsaurus/ytsaurus/pull/1252
commit_hash:e8a1fbb17e2ca3ffe72aafbea943a38624d74491
</content>
</entry>
<entry>
<title>YQL-19747 Enable custom NameSet and FrequencyData</title>
<updated>2025-04-28T15:13:27Z</updated>
<author>
<name>vityaman</name>
<email>vityaman.dev@yandex.ru</email>
</author>
<published>2025-04-28T14:50:31Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/commit/?id=f35bf94dbc72f06a35459f8d854866b83b9a49ea'/>
<id>urn:sha1:f35bf94dbc72f06a35459f8d854866b83b9a49ea</id>
<content type='text'>
Clients might want to use custom `NameSet` and `FrequencyData` in their environment, for example, to get their private UDFs and to have more relevant ranking that includes their private UDF and respect their usage pattern.

To achieve this goal I decided to load pure `NameSet` and `FrequencyData` and provide functions for pruning. Also I checked defaults and decided that it is more common for a client to create a `StaticNameService` from pure `NameSet` and `FrequencyData` to keep their pruning consistent.

I also extracted a separate module `ranking`. It will be needed when I will implement `UnionNameService` to union `StaticNameService` and `SchemaNameService`. `UnionNameService` will load `Limit` names from each child and then crop them to sorted prefix of length `Limit` using `IRanking`.

---

- Related to `YQL-19747`
- 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/1246

Co-authored-by: vvvv &lt;vvvv@yandex-team.com&gt;
Co-authored-by: vvvv &lt;vvvv@yandex-team.com&gt;
commit_hash:cdca301a58a34e56d537a447b4ff779cd70faea6
</content>
</entry>
</feed>
