<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ydb/yql/essentials/sql/v1/complete/sql_complete.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:07:06Z</updated>
<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 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: Refactor sql/v1/complete usage of Future and Ptr</title>
<updated>2025-04-25T13:30:34Z</updated>
<author>
<name>vityaman</name>
<email>vityaman.dev@yandex.ru</email>
</author>
<published>2025-04-25T13:08:47Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/commit/?id=2b59203eb9ccded916b53b3410e3f15abf4b623f'/>
<id>urn:sha1:2b59203eb9ccded916b53b3410e3f15abf4b623f</id>
<content type='text'>
- [x] Chained futures, add `CompleteAsync` method (then will migrate the YDB CLI on it).
- [x] Removed deadlined and fallback NameService as unused
- [x] Annotate thread-safe methods with `const` and use `AtomicSharedPtr` for them.
- [x] Move `name` to `name/service` with backward compatibility with the YDB CLI.

---

`CompletionEngine` is left thread-unsafe because of the dependency chain `CompletionEngine -&gt; LocalSyntaxAnalysis -&gt; C3Engine` which is thread-unsafe, but readonly indexed data structures such as `Ranking` and `NameService` are annotated with const and distributed via shared pointers.

I removed deadlined and fallback name services because the first is stupid the second is ahead of its time and is better to be added later to keep interfaces as minimal as possible.

---

The migration on async complete plan:
1. Introduce CompleteAsync
2. Migrate clients on CompleteAsync
3. Make Complete to return Future
4. Migrate clients on Complete
5. Remove CompleteAsync

---

- Related to https://github.com/ydb-platform/ydb/issues/9056
- Related to https://github.com/vityaman/ydb/issues/33
- Related to https://github.com/vityaman/ydb/issues/31

---

Pull Request resolved: https://github.com/ytsaurus/ytsaurus/pull/1241

Co-authored-by: vvvv &lt;vvvv@yandex-team.com&gt;
Co-authored-by: vvvv &lt;vvvv@yandex-team.com&gt;
commit_hash:497cc081ab78bebf7354e0acfaa418d936cc8240
</content>
</entry>
<entry>
<title>YQL-19747 Remove default completion engine factory</title>
<updated>2025-04-15T11:57:48Z</updated>
<author>
<name>vityaman</name>
<email>vityaman.dev@yandex.ru</email>
</author>
<published>2025-04-15T11:30:08Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/commit/?id=c3eed92629687af94073f570c29ea338bdd66548'/>
<id>urn:sha1:c3eed92629687af94073f570c29ea338bdd66548</id>
<content type='text'>
This is to decouple from the `sql/v1/lexer` implementation.

- Related to https://github.com/ydb-platform/ydb/issues/9056
- Related to https://github.com/vityaman/ydb/issues/18
- Following https://github.com/ydb-platform/ydb/pull/16820

---

Pull Request resolved: https://github.com/ytsaurus/ytsaurus/pull/1196
commit_hash:4995f3a7cb14b0b735a48e211111764f65be8033
</content>
</entry>
<entry>
<title>YQL-19747 Rank keywords just by plain usages</title>
<updated>2025-04-14T10:40:02Z</updated>
<author>
<name>vityaman</name>
<email>vityaman.dev@yandex.ru</email>
</author>
<published>2025-04-14T10:06:15Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/commit/?id=14005fcfba8efa6918e54d823bff6780d9922f8f'/>
<id>urn:sha1:14005fcfba8efa6918e54d823bff6780d9922f8f</id>
<content type='text'>
- [x] Rank keywords just by plain usages
- [x] `LocalSyntaxAnalysis` now returns a mapping `:: Keyword -&gt; [Following Keywords]`.
- [x] Extracted keyword sequence formatting from `syntax/local` to `syntax/format`.
- [x] Extracted token display logic from `syntax/local` to `antlr4/vocabulary` as it is ANTLR dependent.

---

Example

```python
$ ./yql_complete &lt;&lt;&lt; "select "
[Keyword] CAST(
[Keyword] NULL
[Keyword] NOT
[FunctionName] If(
[FunctionName] Yson::ConvertToString(
[FunctionName] Count(
[FunctionName] Sum(
[FunctionName] Unwrap(
[FunctionName] Coalesce(
[Keyword] DISTINCT
[Keyword] ALL
[Keyword] CASE
[FunctionName] Max(
[Keyword] FALSE
[FunctionName] Some(
```

---

- Related to https://github.com/ydb-platform/ydb/issues/9056
- Related to https://github.com/vityaman/ydb/issues/17

---

Pull Request resolved: https://github.com/ytsaurus/ytsaurus/pull/1197
commit_hash:f42cb4aaffe6de7c9137069c4d9c635ee110a805
</content>
</entry>
<entry>
<title>YQL-19747 Complete select and insert hints</title>
<updated>2025-04-09T15:12:05Z</updated>
<author>
<name>vityaman</name>
<email>vityaman.dev@yandex.ru</email>
</author>
<published>2025-04-09T14:57:35Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/commit/?id=394fee4aa8d48e58cf82c72bcb9dda0a5dd50190'/>
<id>urn:sha1:394fee4aa8d48e58cf82c72bcb9dda0a5dd50190</id>
<content type='text'>
- Related to https://github.com/ydb-platform/ydb/issues/9056
- Related to https://github.com/vityaman/ydb/issues/19

---

Pull Request resolved: https://github.com/ytsaurus/ytsaurus/pull/1189
commit_hash:7f1cb1dcf0617aa2c94c3f2188fc9bd481380252
</content>
</entry>
<entry>
<title>YQL-19747 Complete after PRAGMA and multi-token names</title>
<updated>2025-04-08T13:26:47Z</updated>
<author>
<name>vityaman</name>
<email>vityaman.dev@yandex.ru</email>
</author>
<published>2025-04-08T13:11:56Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/commit/?id=2f90258cf6f1625ba0c99f6f37b6c9f336590534'/>
<id>urn:sha1:2f90258cf6f1625ba0c99f6f37b6c9f336590534</id>
<content type='text'>
- [x] Complete after PRAGMA
- [x] Complete multi-token names correctly, for example, `yt.` returns only `DisableStrict`, not `yt.DisableStrict` and `DateTime::` returns `Split`, not `DateTime::Split`.

I tried to implement it using `CompletedToken` edition, but not all completion environments support candidates with various `contextLen` (`Replxx` does not). So I decided that completions should rewrite only the current token, not sequences. For example, on `DateTime::Spl` rewrite only `Spl`. It makes sense as multi-token names have some namespace separated by a punctuation, so used types only namespace and gets names inside of it.

---

Pull Request resolved: https://github.com/ytsaurus/ytsaurus/pull/1181
commit_hash:9d8967ac43b9348f6dbb53837d92a9dcc9b51f48
</content>
</entry>
<entry>
<title>YQL-19747 Improve yql_complete tool and add input validation</title>
<updated>2025-04-07T21:17:32Z</updated>
<author>
<name>vityaman</name>
<email>vityaman.dev@yandex.ru</email>
</author>
<published>2025-04-07T20:50:34Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/commit/?id=5af5cb3b7b423f2d3fcebf2e1406d37cbd6f3bbf'/>
<id>urn:sha1:5af5cb3b7b423f2d3fcebf2e1406d37cbd6f3bbf</id>
<content type='text'>
No description

---

Pull Request resolved: https://github.com/ytsaurus/ytsaurus/pull/1185
commit_hash:1def5874ff6a9a5b3dcdd0ad285d2e64b16c9306
</content>
</entry>
<entry>
<title>YQL-19747 Complete token sequences</title>
<updated>2025-04-02T18:36:46Z</updated>
<author>
<name>vityaman</name>
<email>vityaman.dev@yandex.ru</email>
</author>
<published>2025-04-02T18:25:29Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/ydb/commit/?id=bf8b24c06de4df2df3bf8e40e82caba8f5528301'/>
<id>urn:sha1:bf8b24c06de4df2df3bf8e40e82caba8f5528301</id>
<content type='text'>
Token sequences plan
- [x] [Easy] Support `GROUP BY`, `ORDER BY`.
- [x] [Easy] Support `Optional&lt;`, `List&lt;`, `Dict&lt;`.
- [x] [Easy] Support `Avg(`, `Sum(`.

---
Co-authored-by: Victor Smirnov [53015676+vityaman@users.noreply.github.com]

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