summaryrefslogtreecommitdiffstats
path: root/yql/essentials/sql/v1/format
Commit message (Collapse)AuthorAgeFilesLines
* SQL parser + type annotation for Materialize statementudovichenko-r8 days2-0/+25
| | | | | | | | | | | | | | #### SQL Parser and Type Annotation for Materialize Statement ✎ - Added support for the `MATERIALIZE` SQL statement including parser rules and syntax highlighting updates - Implemented type annotation and validation for the `MATERIALIZE` statement with proper error handling - Enhanced SQL query processing to handle `MATERIALIZE` statements in various contexts including subqueries and limited views - Added runtime support for `MATERIALIZE` operations with sort preservation and proper data sink handling - Integrated `MATERIALIZE` into the SQL grammar and updated completion suggestions - Added comprehensive unit tests covering various `MATERIALIZE` scenarios and edge cases <a href="https://nda.ya.ru/t/qa0kX64r7DqvtN"><font size="2">Autodescription by Yandex Code Assistant</font></a> commit_hash:32b04f93ceadf624b4d39fd6512798f9354bfd80
* Intermediate changesrobot-piglet9 days3-7/+23
| | | | commit_hash:3682aa4bbce05c002af982ecdc21ea73784a939e
* YQL-21134: Set UnstableFormat AST flag unconditionallyvitya-smirnov10 days4-8/+14
| | | | | | | - Renamed `TAstNodeFlags::IgnoredContent` to `TAstNodeFlags::UnstableFormat` to better reflect its purpose. - Removed the `MarkQueryTextAtomWithIgnoredContent` translation setting. The `UnstableFormat` flag is now unconditionally applied to query text atoms during parsing. - Updated `CheckedFormat` and `ValidateAST` to accept an already parsed AST. Since the flag is now set unconditionally, we can reuse the initial AST for format validation. This avoids re-parsing the original query, reducing redundant AST builds and overall RAM consumption. commit_hash:bba3e6733d3a9c120cf9724a161e603de0cfc038
* YQL-20631: Introduce WITH CTE syntaxvitya-smirnov10 days2-60/+260
| | | | commit_hash:77f0128cac891f08ce6c8f9a721f66f69032c44e
* YQL-21134: Introduce not strict AST equalityvitya-smirnov2026-06-106-91/+116
| | | | commit_hash:6d140dd812ad22bada6b8680e160b74b599f7032
* Watermarks: YQL: Fix table hintsvokayndzop2026-06-042-6/+51
| | | | commit_hash:feaa364ef3d3f71bfa70a7d64e2cc6e3854d79a5
* YQL-20855: Support NULL as a type namevitya-smirnov2026-05-272-0/+33
| | | | commit_hash:e420d2d62e3a77af79abbec946f1008c1fa359c6
* YQL-16277: Implement frontend for COMBINE commandimunkin2026-05-132-0/+67
| | | | commit_hash:5a7847c000c3e5ec4cadf6880184d3eebb26d3b1
* YDB: Rename "max_shards_in_flight" COMPACT option to "parallel"vitaliff2026-04-301-2/+2
| | | | commit_hash:a0f516a47f201ca41f812f97fa2ea198cb33edd4
* allow syntax selection in the formattervvvv2026-04-232-2/+18
| | | | commit_hash:c01e7f189b7eec0291cbda0e09b815d7bca8ecc9
* YQL-20882: Ensure formatting and lexer checks are OK on pgSQLvitya-smirnov2026-04-146-0/+110
| | | | commit_hash:153e546ce3d52153d488b9b36d63c3b44f5a959f
* YQL-20095: Enable readability-isolate-declarationvitya-smirnov2026-04-131-1/+2
| | | | commit_hash:c180c2db4897962cb70063ffdc2ddcd21e5e3418
* YQL-21058: Allow no SQL-statements under a SQL flagvitya-smirnov2026-04-082-2/+30
| | | | commit_hash:8e8b69c49159fb6ea51c1f9cd0f49e8d8d52f5ee
* YQL-21134: Do not check formatted AST on CREATE VIEWvitya-smirnov2026-04-071-62/+158
| | | | commit_hash:1465f98162ca2b71d5b4c0d8088af25f68cd1d3b
* Replace unreachable with *_ENSURE(false, ...)atarasov52026-04-011-2/+3
| | | | commit_hash:7c1445375e838a9327006528cb455c9899e9b32d
* YQL-21048: Allow GROUPING SETS trailing commavitya-smirnov2026-03-242-0/+73
| | | | commit_hash:74d8018418c82541d856eda2696500c0718d082b
* Add per column encoding settings YQL grammarvladilenmuz2026-03-181-0/+12
| | | | | | | Task in github: <https://github.com/ydb-platform/ydb/issues/27470> RFC: <https://github.com/ydb-platform/ydb-rfc/blob/main/cs_column_encodings.md> commit_hash:da6b89209ce4ecc2a140507212dfedfc35bc5ccb
* YQL-20538: Introduce --test-triple-formatvitya-smirnov2026-03-125-24/+90
| | | | | | | | | | | | | Can not enable an option `--test-double-format` because a lot of Query Replay failures which are hard to fix, so introducing this option to temporarly relax the formatter requirements to enable at least such check on a Query Replay. It is not enabled in tests, because a `--test-double-format` is already enabled there and it is more strict. Also fixed a bug with multiline comments NL preservation. commit_hash:3c42dcf4b0b00026a97643a0031d2a3a8a319a1a
* YQL-20095: Enable modernize-raw-string-literalvitya-smirnov2026-03-061-7/+7
| | | | | https://clang.llvm.org/extra/clang-tidy/checks/modernize/raw-string-literal.html commit_hash:80a511a46b35539fa1f834d4fb5de452ccfbe0ac
* Intermediate changesrobot-piglet2026-03-032-7/+12
| | | | commit_hash:a66d1ef65085fb8e8bfe860b8b7a95cbc5793851
* YQL-20095: Enable modernize-pass-by-valuevitya-smirnov2026-03-021-6/+8
| | | | commit_hash:4939dfad654f18bb31e40711ee0c39063889f17b
* Revert YQL-20538: Fix format on no semicolon after a commentvitya-smirnov2026-03-022-119/+21
| | | | | That PR produced much more bad double formattings. commit_hash:b8340c9b685ea4ab790a72d98f616e1aa2d93830
* Intermediate changesrobot-piglet2026-02-261-24/+24
| | | | commit_hash:d7143d999c6383c49b3e32ea07930fde8292ce15
* YQL-20538: Fix format on no semicolon after a commentvitya-smirnov2026-02-262-21/+119
| | | | | Behavior is strange, but it is at least converges now. commit_hash:4e81b1ec46824fb7a1d65fa5132aab99634378bd
* YQL-20538: Fix format on named node line commentvitya-smirnov2026-02-262-27/+105
| | | | | | | | | The problem is that a space (`' '`) followed by a openning brace (`(`) were always unconditinally inserted, which is true when it comes just after an assignment (`'='`), but does not work correctly, when an `=` is followed by a comment, so the brace-wrapped select statement should start on a next line. commit_hash:23521a65125e41f199a6244c5501fc17c5b01b85
* Add trace_ids parameter to changefeedkseleznyov2026-02-261-0/+4
| | | | | | | | | Задача связана с работами по <https://nda.ya.ru/t/ojQZrhvH7VKBSc> Суть: Необходимо в CDC-топиках сохранять информацию о сквозной трассировке, но эта фича должна быть опциональной. Также задание связано c <https://nda.ya.ru/t/N-MMqlP17VKBfi> commit_hash:4f9d0763a4b927e83def862b7bcb6f6739f952cc
* implement set drop default parser support KIKIMR-24829gvit2026-02-221-0/+4
| | | | | <https://github.com/ydb-platform/ydb-rfc/pull/239> commit_hash:b74e2a178f47f429e36d8bc30049862885190bd3
* Add USER_SIDS parameter to changefeedkseleznyov2026-02-161-0/+4
| | | | | | | | | Задача связана с работами по <https://github.com/ydb-platform/ydb/issues/11405> (Необходимо в CDC-топиках сохранять информацию о пользователях и TTL-операциях) Косвенно, задание связано с commit_hash:15dfe1da2f5690ae90c8ffe2043b7f4cc27006f7
* YQL-20949: Allow trailing comma at object featuresvitya-smirnov2026-02-132-2/+14
| | | | | Also add a newline after a trailing comma. commit_hash:215a5e5e506e50e197ebf776cdcb89c9d2d0db92
* Add ALTER TABLE COMPACT statementivannik2026-02-111-0/+6
| | | | | | | | `ALTER TABLE table_name COMPACT [WITH (CASCADE = false|true, MAX_SHARDS_IN_FLIGHT = N)];` RFC: https://nda.ya.ru/t/3sKflLJJ7U6Jyv Github Issue: https://github.com/ydb-platform/ydb/issues/33852 commit_hash:b78d125282c378a06d0f743684b13782c8849422
* YQL-20095: Enable misc-definitions-in-headersvitya-smirnov2026-01-301-0/+2
| | | | | | | | - https://clang.llvm.org/extra/clang-tidy/checks/misc/definitions-in-headers.html Just applied auto-fix. Maybe it is worth to manually move functions to `.cpp` files, but I was too lazy. I will do it, if you wish. commit_hash:6ba1b2f014eb1f25dede1299f073e33d823b4ddf
* Intermediate changesrobot-piglet2026-01-294-54/+58
| | | | commit_hash:3fc8faa25000417fd21875d20df0ff007764c7ea
* YQL-20837: Respect original newlines at formatterlukashevich842026-01-262-13/+110
| | | | commit_hash:862362f17e02a0d50b3a568aedc0c490c05ea9a7
* YQL-20095: Enable google-explicit-constructorvitya-smirnov2026-01-231-1/+1
| | | | commit_hash:4d77ad10fd4db303459ec4e45e139967c7fc8196
* support streaming disposition in streaming queriesgrigoriypisar2026-01-211-6/+6
| | | | commit_hash:4a122e23fcc9c4b652ec7eae7cb546501a33748c
* YQL-20436: Support trailing comma at VALUES and ASvitya-smirnov2025-12-262-3/+22
| | | | commit_hash:ac7d78346879d05bd141d6b9b207cba179a87165
* YQL-19017: Remove TTranslationSettings::Antlr4Parservitya-smirnov2025-12-103-8/+4
| | | | | Then I will remove an `Antlr4Parser` usages from the YDB. commit_hash:0183482e46de023f71698e03db9a0c51ef10fe98
* New statement TRUNCATE TABLEflown4qqqq2025-12-022-0/+19
| | | | commit_hash:f6dfab4a7add0379cacefb943c702ae065750654
* Per column compression settings YQL grammarneyrox2025-11-111-1/+5
| | | | | Task: <https://github.com/ydb-platform/ydb/issues/27621> commit_hash:84cb8e3fcab66d48c1861e63fc9d33afb06478dc
* Use Y_UNREACHABLE for ALT_NOT_SETvitya-smirnov2025-10-201-2/+2
| | | | | | | | 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-20490 Drop antlr3 grammarvvvv2025-10-163-20/+3
| | | | commit_hash:6c5c638d87eb41018d637f1535af104fac16e51c
* YQL-20504: Fix formatting check in QPlayersvitya-smirnov2025-10-134-0/+134
| | | | commit_hash:cbb6bbe39c72e2322d57a38ded86cda07c68a419
* YQL-20086 invert flagvvvv2025-10-101-2/+0
| | | | commit_hash:a6b640bc576263b62884a0b4187ba79c893e13d9
* YQL-20086 sql/v1vitya-smirnov2025-10-076-1230/+1191
| | | | commit_hash:55bc611cdaa0d8a0fc3c4c7708ed9f17cc4976cf
* support consumers' availability_period setting in the yqlswarmer2025-10-061-1/+4
| | | | | KIKIMR-24054 commit_hash:b7c840d6f25ec732f818f8760e8ce8819393901e
* YQL-20307: Support inline subqueriesvitya-smirnov2025-10-012-73/+180
| | | | | | | | | | | - 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
* The ability to specify not null, default, family in any orderflown4qqqq2025-09-231-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Проблема в следующем. Есть запрос: ```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
* KIKIMR-23992: Add secret SQL operations – create, alter, dropyurikiselev2025-09-052-0/+45
| | | | commit_hash:3b74a89e67fd29fdced780847365861db726b687
* added sql syntax for CREATE / ALTER DROP STREAMING QUERYgrigoriypisar2025-08-282-0/+97
| | | | | | | | | | | | | | | | | | | | | | | Добавлен синтаксис (переиспользован код для inline action): ``` CREATE [OR REPLACE] STREAMING QUERY [IF NOT EXISTS] query_name [WITH ( key = value ... )] AS DO BEGIN ... END DO; ALTER STREAMING QUERY [IF EXISTS] query_name [SET( key = value ... )] [AS DO BEGIN ... END DO]; DROP STREAMING QUERY [IF EXISTS] query_name; ``` commit_hash:29fa6aa7e61ecf45112480fe3c1df8fab542354e
* Feature: alter table T alter column C set not nullflown4qqqq2025-07-211-0/+2
| | | | | | | | | Когда-то давно (когда еще YQL жил в github) была поставлена задача - поддержать SET/DROP NOT NULL на колонку. DROP NOT NULL был сделан и давно уже существует в main: <https://github.com/ydb-platform/ydb/pull/6342>. Однако с SET NOT NULL возникли определенные сложности, поэтому был сделан отдельный пулл реквест: <https://github.com/ydb-platform/ydb/pull/6341>. Как видно, ПР так и не вмержили по причине увольнения автора кода. Недавно задача всплыла вновь, поэтому надо доделать. В этом пулл реквесте добавляется код в грамматику YQL новое выражение - `ALTER TABLE t ALTER COLUMN c SET NOT NULL`, которая добавляет ограничение `NOT NULL` на колонку. commit_hash:f310061b13666418c46309ea32032fbce68fb865