aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/sql/v1/complete/core
Commit message (Collapse)AuthorAgeFilesLines
* YQL-19747: Complete table functionsvitya-smirnov6 days1-0/+5
| | | | | | | | | | | | - 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
* YQL-19747: Respect WITHOUT at schema synthesisvitya-smirnov14 days2-0/+19
| | | | | | | | | 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
* YQL-19747: Fix self-join completionvitya-smirnov2025-06-251-0/+24
| | | | | | | | 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
* YQL-19747: Complete columns from JOINvitya-smirnov2025-06-232-0/+9
| | | | | | | Collect tables with aliases during global analysis and send a multiple requests to a schema provider. commit_hash:51cbc40cee6cda09d5bfe256a0425e7c809c04f5
* YQL-19747: Support table aliasesvitya-smirnov2025-06-181-0/+8
| | | | commit_hash:6d67ec1fa5023083debd89aaa99950019ca37c90
* YQL-19747: Complete columns at simple selectvitya-smirnov2025-06-174-0/+20
| | | | | 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
* YQL-19747: Support immediate string named expressionsvityaman2025-05-273-0/+22
| | | | | | | | | | | --- - 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
* YQL-19747: Recover from unclosed ID_QUOTEDvityaman2025-05-201-0/+5
| | | | | | | | | | | | | | | | 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
* YQL-19747 Complete folder, table and cluster namesvityaman2025-05-064-0/+41
| | | | | | | | | | | | | | | | --- - 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
* YQL-19747 Detect a token at the caret positionvityaman2025-04-231-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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<#>` got nothing because `<>` 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
* YQL-19747 Complete select and insert hintsvityaman2025-04-092-0/+13
- 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