summaryrefslogtreecommitdiffstats
path: root/yql/essentials/sql
Commit message (Collapse)AuthorAgeFilesLines
...
* Drop excess check in InitKeysOrFiltersimunkin2025-11-142-5/+13
| | | | commit_hash:af116e58e8f817d39aee66f0d0a5e7f1a5a62d03
* YQL-20436: Translate VALUES statement to YqlSelectvitya-smirnov2025-11-143-23/+67
| | | | commit_hash:e2c8bcd9d8fd5ceb294d1fb3c6b1d15993dbb8f9
* YQL-20436: Add YqlSelect to differential testingvitya-smirnov2025-11-135-38/+100
| | | | | | | | | | | | | | | | | | | | | | Added `AutoYqlSelect` differential testing target for `minirun` and `yt_file`. It helped to explore at least the following issues: 1. Not set `DeriveColumnOrder` (fixed) 2. Absent `Unordered` decorator (fixed) 3. Unsupported not fully-qualified `VALUES` (fixed) 4. Premature cluster check leading to error instead of an unsupported status (fixed) 5. Invalid column name generation (fixed) 6. Absent top-level select column order (postponed) 7. Absent error on column name collision (postponed) 8. Other issues unexplored due to noise from bullet 6. As tests are failing `AutoYqlSelect` is commented out until `YqlSelect` is ready. Also added some missing tests for `LIMIT`/`OFFSET` and `WHERE`. commit_hash:70424260914acff8275f3544e2ad7a99789f7620
* Per column compression settings YQL grammarneyrox2025-11-1110-57/+387
| | | | | Task: <https://github.com/ydb-platform/ydb/issues/27621> commit_hash:84cb8e3fcab66d48c1861e63fc9d33afb06478dc
* YQL-20496: Fix highlighting againvitya-smirnov2025-11-102-4/+13
| | | | | | | | | | | | Fixed [issues](https://nda.ya.ru/t/e98IQkef7Mhm96): 1. Types had higher precedence than UDF and so `Yson::Parse` was badly highlighted. So function unit was split to let types to highlight `Decimal(...)` correctly, as well as UDFs. 2. There was a hack in a Monaco generator (probably I forgot to fix it) with hardcoded rules for embedded language, so JSON rule was forgotted to be deleted. commit_hash:b24527891525dad65bfbafbc209fd3cb7f087f32
* YQL-20436: Translate JOIN to YqlSelectvitya-smirnov2025-11-065-30/+314
| | | | | | | | | The support is actually limited because asterisk is not supported, because of non-trivial to implement YQL semantics where same-named columns at ON clause are deduplicated, will create an task for it. Supported JOIN, LEFT/RIGHT JOIN, CROSS JOIN. commit_hash:789a09fe45f40cb8171badd22ac6c06b366bdd03
* YQL-19673: Realizationmrlolthe1st2025-11-023-5/+95
| | | | commit_hash:68fcce49bf7355e49569a96ff7ad2faa537c563e
* YQL-20496: Fix YQL highlighting dramaticallyvitya-smirnov2025-11-013-3/+9
| | | | | | | | | | - Highlight embedded languages in Shiki - Generate Monaco playground template - Highlight type as type even in function context - Removed an embedded JSON support - Fix YQLs highlighting for Monaco and highlight-js - Fix string embedded language in Monaco commit_hash:d140266b26c73e9623d878a44e7c0c1152d5c437
* Add metrics level to topic commandsqyryq2025-10-294-1/+32
| | | | | | | | | YQL интерфейс для изменения уровня метрик в топиках. <https://github.com/ydb-platform/ydb/pull/22572> <https://nda.ya.ru/t/FVhsdzRH7M7H9z> commit_hash:986e9718421cbea11a976b5f5c19e8ea2384291d
* YQL-20496: Highlight hints as keywordsvitya-smirnov2025-10-292-7/+6
| | | | | | User asked to highlight hints as keywords despite they are actually have options semantics, because it is more familiar and intuitive. commit_hash:9c0b63afea781aabfd33189abddb9d0a0ffbaa08
* YQL-20519: Add multiline pattern for stringsvitya-smirnov2025-10-282-11/+11
| | | | | | | | The problem was that YQL basic string literals are actually multiline and so we need to use range pattern for them. Also this patch highlights embedded JSON as JavaScript in Monarch. commit_hash:83db61d5f3560ca914fd277df5fef6f242fa0d30
* YQL-20498 more missing functionsvvvv2025-10-251-1/+37
| | | | commit_hash:5e1cc906e5ea76fda28355fb9def0236605e1fd7
* Support views and TablePathPrefix in partions/partition_listaneporada2025-10-241-17/+33
| | | | commit_hash:2e7c16f7cf69959623ab20e6a44f27be38afe70b
* YQL-20564 fixed singular types availabilityvvvv2025-10-241-0/+3
| | | | commit_hash:59fbd02c0cb455f6670e3e85ea9f5436f4e4f7c8
* Initial support of CREATE TABLEAnton Romanov2025-10-242-140/+165
| | | | | | | | | | | | | | | Type: feature Component: query-tracker --- Pull Request resolved: https://github.com/ytsaurus/ytsaurus/pull/1457 Co-authored-by: aneporada <[email protected]> Co-authored-by: aneporada <[email protected]> Co-authored-by: aneporada <[email protected]> Co-authored-by: Tony-Romanov <[email protected]> commit_hash:e3ef0061d4a0469da3c5cda9ec32a1d0476e4bfe
* YQL-20498 more pg & missing functionsvvvv2025-10-231-4/+84
| | | | commit_hash:18698e72d2e575212150eb234da6f22dc69a9d96
* YQL-20498 more pg & missing functionsvvvv2025-10-211-2/+83
| | | | commit_hash:add2f391888f47fb6a57a3a985cb0c391d9054ac
* YQL-20436: Extend YqlSelect translation supportvitya-smirnov2025-10-216-57/+558
| | | | | | | | | | | New supported SELECT-features: - `SELECT * FROM ...` - `SELECT ... FROM cluster.table` - `SELECT ... FROM (SELECT ...)` - `SELECT ... FROM ... WHERE expr` - `SELECT ... FROM ... ORDER BY sort+` - `SELECT ... FROM ... LIMIT expr OFFSET expr` commit_hash:9c6981a26050b52ed1943a325476164673806256
* YQL-20555 nullifvvvv2025-10-211-0/+1
| | | | commit_hash:4a2e71c935ef62a45d8fd13f180e81464a446441
* YQL-20498: SimplePg infrastructurevvvv2025-10-203-2/+76
| | | | commit_hash:309ca86c90175be5a1e016c3e6a5160ba04034e6
* Use Y_UNREACHABLE for ALT_NOT_SETvitya-smirnov2025-10-2016-224/+188
| | | | | | | | It is not convinient to grep "You should change implementation according to grammar changes" every time you need it during new translation feature. AI does not always suggests it. More convinient is to use just `Y_UNREACHABLE` as `ALT_NOT_SET` is actually unreachable. commit_hash:132f264e9f781b8c2433fb1f12374f7684466370
* YQL-20520 concat (w/o runtime)vvvv2025-10-201-0/+1
| | | | commit_hash:0b092481cfb4813c26c165c17f6d05a9f1f88481
* YQL-20496: Fix an option highlighting patternvitya-smirnov2025-10-204-14/+59
| | | | | | | There was a bug with highlighting an identifier a in expression a == b as an option. So for an option match we expect an exactly = token. So all hints are enumerated and the solid regex is built. commit_hash:8df3cd082a7eaa99fc06daa282ba6dd9f0798f6f
* YQL-20339 autocompletevvvv2025-10-192-0/+8
| | | | commit_hash:40a9b2cb7a03d72a1d908bf5da773e6518b6123c
* YQL-20528: Fix layers acceptancemrlolthe1st2025-10-171-1/+1
| | | | commit_hash:0d39a8815f2fbe811e0c42ba9b7ce0c727c0fd35
* New CREATE VIEW syntaxaneporada2025-10-176-64/+233
| | | | commit_hash:1a15c50554dcb4f50688a324bbd91b9d49076c8f
* YQL-20339 composite types in grammarvvvv2025-10-173-0/+27
| | | | commit_hash:2fc2878449f90c948e0cd75a3c1d59f07d660620
* YQL-20490 Drop antlr3 grammarvvvv2025-10-1642-3050/+35
| | | | commit_hash:6c5c638d87eb41018d637f1535af104fac16e51c
* YQL-20436: Translate `SELECT .. FROM VALUES ..` to `YqlSelect`vitya-smirnov2025-10-1412-3/+871
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Current `SQLv1` translation produces relatively low level `YQLs` constructions that are hard to match during later optimizations, for example, subqueries unnesting. Also it assumes that expressions are only depend on corresponding source row, which is not true for correlated subqueries. Both limitations blocks currelated subqueries implementation. Although the problem exists for `SQLv1`, it is already solved for `PG` syntax. There PostgreSQL-produced AST is converted to special `YQLs` "bulk select" node called `PgSelect`. It is more declarative and expanded later than translation. This fact helped to support correlated subqueries, which with `PgSelect` are type-checkable and decorrelatable (not generally, but heuristically). This patch is the first step forward to "bulk select" translation for `SQLv1`. As there are a lot of code already written for `PgSelect` and `PG` and `SQLv1` relatively similar, I decided to rebrand `PgSelect` into more general `SqlSelect` node. It seems that for some near future goals `PgSelect` should be enough. There was 2 problems solved: 1. `PgSelect` comes with `OrderedColumns` by default and its implementation tightly coupled with it. 2. `PgSelect` does Pg type casts. This patch contains following changes: - Added pragma `YqlSelect = 'disable' | 'auto' | 'force'` - Added `YqlSelect` (`PgSelect` alias) translation - Changed `PgSelect` wrappers to support `YqlSelect` - Changed `PgSelect` expanders to support `YqlSelect` commit_hash:8a55d63e06c22592b2029dd260bbd259194e92dc
* YQL-20504: Fix formatting check in QPlayersvitya-smirnov2025-10-134-0/+134
| | | | commit_hash:cbb6bbe39c72e2322d57a38ded86cda07c68a419
* YQL-20086 invert flagvvvv2025-10-1032-2122/+2026
| | | | commit_hash:a6b640bc576263b62884a0b4187ba79c893e13d9
* YQL-20072: Init pragma Layer and yt.LayerCachesmrlolthe1st2025-10-104-5/+27
| | | | commit_hash:9199da15c695cf5c8a492750a8bcfbb0f31c0b34
* YT-25914: [cbo] use column DataWeight + update cost function + add version ↵lucius2025-10-093-0/+22
| | | | | | | | | | | | | pragma Новая кост-функция для cbo. Под флагом чтобы удобнее сравнивать со старой. 2 изменения: - Для оценки размера входных таблиц используется поколоночный dataweight (если есть), а не таблица целиком - В самой кост-функции убран outputSize, чтобы он не учитывался дважды: он неявно учтен в каждом следующем джоине как левый либо правый inputSize, а размер результата последнего джоина не зависит от перестановки джоинов commit_hash:d130848393114b1b4383035381dba7767aac62fb
* YQL-20496: Improve YQL highlightingvitya-smirnov2025-10-096-15/+58
| | | | commit_hash:edf72fd8386c41f858f677152612bd58680506a6
* Implement partitions() table functionaneporada2025-10-083-0/+44
| | | | commit_hash:19bbcd26d46a4ca8d18f0dbae605b48ac823c614
* YQL-20086 sql/v1vitya-smirnov2025-10-07223-23152/+22903
| | | | commit_hash:55bc611cdaa0d8a0fc3c4c7708ed9f17cc4976cf
* support consumers' availability_period setting in the yqlswarmer2025-10-065-26/+72
| | | | | KIKIMR-24054 commit_hash:b7c840d6f25ec732f818f8760e8ce8819393901e
* YQL-20116: Introduce ANTLR4 ambiguity detectionvitya-smirnov2025-10-067-14/+69
| | | | | | - Ignored 2 known ambiguities. - Tested tools. commit_hash:9e29bb2f876dabc68293b3e5c26a470d373506ae
* YQL-20086: Format yql/essentials/sql/v1/highlightvitya-smirnov2025-10-029-405/+407
| | | | | | | | | | | | | | | | This patch adds a style check for `yql/essentials/sql/v1`. To format use `ya style`. To test use `ya test ya test --test-type clang_format`. To enable style checking in a module, need to add: `ENABLE(YQL_STYLE_CPP)`. So in a such way we gradually will format all YQL modules, expect those, where fluent YQL-builders are used. Then we will revert activation macro, so switch from `ENABLE(YQL_STYLE_CPP)` to`ENABLE(YQL_STYLE_CPP_XFAIL)`. Guide: <https://nda.ya.ru/t/XzkoRIGg7KjXmq>. commit_hash:fa758a214e094c74821fe896184f30483dd18c55
* YQL-20307: Support inline subqueriesvitya-smirnov2025-10-0122-203/+952
| | | | | | | | | | | - Alter grammar to support inline subqueries. - Support inline subqueries in `sql/v1` (translator). - Introduce `sql/v1/proto_ast/parse_tree.h` for reusable parse tree predicates. - Support inline subqueries in `sql/v1/format`. - Support inline subqueries in `sql/v1/complete`. - Add some SQL-tests. - Pass all tests. commit_hash:075b2240778d071e1c7542f912d3cc83019ef849
* Implement partition_list table functionaneporada2025-09-293-0/+33
| | | | commit_hash:dba6cae7baee068a70013da4dc3377a10f2d4d22
* YQL-19616: Optimize regexes for Monarchvitya-smirnov2025-09-292-75/+77
| | | | | | | Monarch regex engine is so slow on regexes like `([A-Z]|[a-z]|_|[0-9])*`, but works well on `([A-Za-z_0-9])*`. So such optimization is added. commit_hash:b749e59818a20d7fd1d1ba21b233e1467e9d6ced
* YQL-20461: Normalize table function namesvitya-smirnov2025-09-292-8/+20
| | | | | So now both `AsTable` and `AS_TABLE` work. commit_hash:ae8c33f44e7b10de02a9d979373f4b0602ff0b12
* Fix -Wunused-but-set-variable in yqlmikhnenko2025-09-265-7/+7
| | | | | | | If you think that this pr has broken something for you, roll it back If the problem is not trivial, come to [support](https://nda.ya.ru/t/a1JIzEbo78mtfQ) Original errors you can see [here](https://nda.ya.ru/t/pFJQM0ho7KSaTN commit_hash:77d426cfbc646733517e14e69ac61a1afedaf82f
* YQL support fulltext index typekungasc2025-09-233-3/+12
| | | | | part of https://github.com/ydb-platform/ydb/issues/23384 commit_hash:dc3c331d4054a7739ca632ddce312c985d4b8a13
* The ability to specify not null, default, family in any orderflown4qqqq2025-09-239-38/+432
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Проблема в следующем. Есть запрос: ```sql CREATE TABLE series_with_families ( series_id Uint64, title Utf8, series_info Utf8  NOT NULL FAMILY family_large, release_date Uint64, PRIMARY KEY (series_id), FAMILY default ( DATA = "ssd", COMPRESSION = "off" ), FAMILY family_large ( DATA = "rot", COMPRESSION = "lz4" ) ); ``` Такой запрос является на данный момент неверным на уровне грамматики. Ругается на строку \``series_info Utf8  NOT NULL FAMILY family_large`\` Однако запрос, в котором NOT NULL и FAMILY поменяны местами, отрабатывает корректно: ```sql CREATE TABLE series_with_families ( series_id Uint64, title Utf8, series_info Utf8 FAMILY family_large NOT NULL, release_date Uint64, PRIMARY KEY (series_id), FAMILY default ( DATA = "ssd", COMPRESSION = "off" ), FAMILY family_large ( DATA = "rot", COMPRESSION = "lz4" ) ); ``` В этом Pull Request'е я меняю грамматику таким образом, чтобы была возможность задавать "опции" колонки (DEFAULT, NOT NULL, FAMILY). Особое внимание стоит обратить внимание на тест `CreateTableDefaultAndNotNullInOrderSpace`: в нем показывается, что можно использовать синтаксис ```sql CREATE TABLE tbl ( k Uint64, v Bool DEFAULT false NOT NULL, PRIMARY KEY (k) ); ``` И такое поведение означает именно DEFAULT (false NOT NULL), то есть DEFAULT true. Дело в том, что выражение "false NOT NULL" эквивалентно "false IS NOT NULL", что является, безусловно, истиной. Ровно для того, чтобы была вообще возможность одновременно указать и default, и not null, было добавлено расширение синтаксиса: теперь можно указывать скобки для указания опций столбца, а сами опции внутри них можно перечислять через запятую: ```sql CREATE TABLE tbl ( k Uint64, v Bool (DEFAULT false, NOT NULL), PRIMARY KEY (k) ); ``` Запрос выше означает, что столбец должен по умолчанию заполняться false'ами, но при этом он должен быть NOT NULL. commit_hash:67cc27a5fe6ae73f8725b051b232c2ca0d1ec54f
* YQL-20339 expr high level funcsvvvv2025-09-221-0/+5
| | | | | init commit_hash:479f16e9cd255b616573d811910403290f9ef656
* Do not use DependsOn in TablePath/TableRecordziganshinmr2025-09-226-3/+21
| | | | commit_hash:0241dcec17f0a9b9cf2abfc955a4af169084c387
* YQL-20339 expr low level funcsvvvv2025-09-223-0/+92
| | | | | init commit_hash:ededd246fa929931de6e89fd5f809157d9fe4d16
* YQL-20339 block function for scoped argsvvvv2025-09-191-0/+1
| | | | | без langver, т.к. может быть использована для починки оптимизаторов, где при раскрытии List-ов из воздуха рождается Iterator а потом все заканчивается Collect commit_hash:21cb9b9454cb255b476d50bdb8c5db150cd773fd