summaryrefslogtreecommitdiffstats
path: root/yql/essentials/tests/sql
Commit message (Collapse)AuthorAgeFilesLines
* YQL-20436: Translate `SELECT .. FROM VALUES ..` to `YqlSelect`vitya-smirnov6 days21-0/+335
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Intermediate changesrobot-piglet6 days291-0/+0
| | | | commit_hash:c106c0b4122e4493aa70f0007e98dff850405f05
* YQL-20072: Init pragma Layer and yt.LayerCachesmrlolthe1st10 days5-0/+54
| | | | commit_hash:9199da15c695cf5c8a492750a8bcfbb0f31c0b34
* YQL-20116: Introduce ANTLR4 ambiguity detectionvitya-smirnov14 days1-0/+1
| | | | | | - Ignored 2 known ambiguities. - Tested tools. commit_hash:9e29bb2f876dabc68293b3e5c26a470d373506ae
* Intermediate changesrobot-piglet2025-10-03139-136/+274
| | | | commit_hash:c3c929f4005b33d2fddb492bbc2c553125d9ad40
* YQL-20307: Support inline subqueriesvitya-smirnov2025-10-0140-3/+1661
| | | | | | | | | | | - 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
* Intermediate changesrobot-piglet2025-10-018-13/+48
| | | | commit_hash:a9a24e2156ccebef387f026b91efcd5628389146
* YQL-20339 linear checkervvvv2025-09-2938-38/+316
| | | | | | | usage types commit_hash:6214c6a10f057439898414592a7b70a178ef14a1
* YQL-20461: Normalize table function namesvitya-smirnov2025-09-292-2/+2
| | | | | So now both `AsTable` and `AS_TABLE` work. commit_hash:ae8c33f44e7b10de02a9d979373f4b0602ff0b12
* YQL-20339 better error pos for dynamic checksvvvv2025-09-261-3/+3
| | | | | init commit_hash:11d97d8b3cbe39684d0813f20fdba59085a2e265
* YQL-20339 merge blocks optimizervvvv2025-09-2613-0/+128
| | | | | init commit_hash:fee9a86a1f95e9271bf49205dad4b6eb0b934dec
* YQL-20226: Wrap unpickle with try catchatarasov52025-09-264-0/+25
| | | | commit_hash:96e8a09d23befb758e60a6e01f691868331af968
* YQL-20339 expr high level funcsvvvv2025-09-2211-0/+128
| | | | | init commit_hash:479f16e9cd255b616573d811910403290f9ef656
* YQL-20339 expr low level funcsvvvv2025-09-2239-0/+652
| | | | | init commit_hash:ededd246fa929931de6e89fd5f809157d9fe4d16
* YQL-20339 block function for scoped argsvvvv2025-09-194-0/+31
| | | | | без langver, т.к. может быть использована для починки оптимизаторов, где при раскрытии List-ов из воздуха рождается Iterator а потом все заканчивается Collect commit_hash:21cb9b9454cb255b476d50bdb8c5db150cd773fd
* Intermediate changesrobot-piglet2025-09-191-1/+1
| | | | commit_hash:ffdf6d88b491ce35a3a038c387250bf3a005ebbc
* SeqMode supportudovichenko-r2025-09-1814-31/+41
| | | | commit_hash:3d0e8bfb46470e6ac36b0d198cfa1723c665f643
* YQL-20339 expr types & reflectionvvvv2025-09-188-0/+79
| | | | | init commit_hash:1c72053b3785a26cfde418f28a9d054b5a624627
* YQL-20423 pending files should postpone all outer evaluationsvvvv2025-09-1514-0/+121
| | | | commit_hash:70c91e881d5f8126d3d1c68a5816f440295330da
* Fix NormalizeEqualityFilterOverJoin with optionalsaneporada2025-09-154-0/+56
| | | | commit_hash:dbf1a2fd200d2699cbc984fd4da357fb79ca3bd9
* Improve optimizer for logical ops over Justaneporada2025-09-094-0/+52
| | | | commit_hash:f29316d37138b6555b2d09a4c67aeef3b447ea60
* Fix 'Distributive law for OR' optimizeraneporada2025-09-094-0/+60
| | | | commit_hash:832d6963d7f12d5ff8da09d883801e65857acaca
* YQL-20258 sql syntaxvvvv2025-09-0857-248/+174
| | | | commit_hash:c2440ce49cc8c7637134ddf8081b32251ff75fd4
* YQL-20258 more tests & refactorvvvv2025-09-084-0/+26
| | | | commit_hash:031b3f5c4215bc9c66d0cea9c8dd8d69a1ec1627
* YQL-20234: Remove predicate argument on middle aggregation phasesvitya-smirnov2025-09-0546-0/+4563
| | | | | | | | | | | Also added tests for: - max_by - agg_list - some - avg_if - sum_if - count_if commit_hash:0da4f3b9b1767850e65c914b727bc362cf4cc125
* YQL-20375: Fix emit of SqlCall external typesimunkin2025-09-041-9/+9
| | | | | Follows up ydb-platform/ydb@34fcd78a2d18d9846fd68339c8e240702857e1e5 commit_hash:08520ae8b837c69f6b92e575882da4786aa441fd
* YQL-20367: Add DisableExceptIntersectBefore202503 feature flagvitya-smirnov2025-09-0412-17/+103
| | | | commit_hash:a8645f7215087df3309048de31a7f0b3dc802a11
* YQL-20368: Fix unsupported literal error positionvitya-smirnov2025-09-041-3/+3
| | | | commit_hash:7007950c8dbbf4d1c8edd5c275eaea723e29e56b
* YQL-20365 ConvertTo, warn for Ensurevvvv2025-09-0310-1279/+1345
| | | | commit_hash:39b07bbc84e57d9df02c839273366c28442b789f
* YQL-20189: Track warnings as errorsvitya-smirnov2025-09-032-3/+7
| | | | | | There was an issue that a query with warnings as errors passed translation. commit_hash:890d18853380b5ad669e9684553cdb6991827cff
* YQL-20368: Improve unimplemented literal errorvitya-smirnov2025-09-032-0/+10
| | | | commit_hash:27dc40f323e5d24af0dae4f3917a63248f8f8386
* YQL-20258 simple1 optvvvv2025-09-0254-128/+407
| | | | commit_hash:ad0cc5722938a8e337f7bc9b5f4a631a299c6a99
* YQL-20345: Disable EXCEPT/INTERSECT/DISTINCT before 2025.03vitya-smirnov2025-09-019-4/+32
| | | | | | Added absent checks for `langVer` at `EXCEPT/INTERSECT/DISTINCT` translation. In next PR will get rid of `.sqlx` file extensions. commit_hash:699cc8f6084d1d2fc19ecd53c35a56496dc842f4
* Intermediate changesrobot-piglet2025-09-015-0/+0
| | | | commit_hash:ffcc5347cf91200515e45d7442de193e20d6edcd
* YQL-20340: Fix getelem comp nodeatarasov52025-08-2823-0/+793
| | | | commit_hash:4b93115d4e3d46770946a7a462c7413d6183282f
* YQL-20341 handle missing table in the join subtreevvvv2025-08-284-0/+54
| | | | | init commit_hash:7169a3cfe8408c4baff8524a8022b5b219900b94
* YQL-20253: Support `FLATTEN [OPTIONAL] BY` for any data typelambda-delta2025-08-2614-0/+235
| | | | | Support `FLATTEN [OPTIONAL] BY` for any data type commit_hash:6fb221fadf29d1dcc7ea4590a21c115fc506aa51
* Intermediate changesrobot-piglet2025-08-197-16/+12
| | | | commit_hash:8ca485c564bd7f0ff3ce9685470a06e07e99d0f4
* YQL-20150: Add OptimizeLMap optimizermaxkovalev2025-08-194-0/+107
| | | | | YQL-20150: Add OptimizeLMap optimizer commit_hash:065921d83e492d815fa95f3e9bedd006aee0c887
* Intermediate changesrobot-piglet2025-08-184-0/+344
| | | | commit_hash:45d5b2e2dd994307de6d103f3b9658f40fd3696b
* Intermediate changesrobot-piglet2025-08-183-7/+7
| | | | commit_hash:44e30306b80ccb5f73f3fc9ab17545e0af3b413f
* Intermediate changesrobot-piglet2025-08-131122-0/+0
| | | | commit_hash:e6cca97ec9c9627f1ba82a11abf454518fc90972
* Intermediate changesrobot-piglet2025-08-1224-0/+0
| | | | commit_hash:ed91bc01a9eb89e8817a6441ee293bf98524290c
* Intermediate changesrobot-piglet2025-08-114-8/+8
| | | | commit_hash:5b0aadf271c553415c536606ff7f52575bd267c4
* YQL-20211 YQL-20223: skip nulls in pushdown over optional sidelucius2025-08-087-0/+451
| | | | | | | | | | | Добавляю поддержку фильтрации нуллов при пушдауне на необязательную сторону джоина (до этого она работала только при пушдауне на обязательную сторону). Как в пушдауне предиката с левой стороны одновременно на правую (PredicatePushdownOverEquiJoinBothSides), так и в пушдауне сразу на правую (FilterPushdownOverJoinOptionalSide). Включается по флагу PredicatePushdownOverEquiJoinBothSides. Тесты с включением можно посмотреть тут: <https://nda.ya.ru/t/e2f09Qw_7HNvu6> commit_hash:0f101bfced2a510995577e1bca90eef6d2505992
* YQL-20247 Depends for Udf functionvvvv2025-08-059-0/+82
| | | | commit_hash:4ee9d9b9079b90e8eeb91accc41d6a3a30c3a18c
* Handle DependsOn with tuple arg in optimizersziganshinmr2025-08-041-3/+3
| | | | commit_hash:1753b28fb549f00ea6ed88d12d64ac9c9ddaddd5
* YQL-20206: Optimize X AND/OR Not X YQL-20229lucius2025-08-0110-0/+231
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Делает возможным такие оптимизации: - `X AND NOT X -> FALSE` - `X OR NOT X -> TRUE` Работает в том числе если X будет завернут в Unessential. Только для неопциональных X. Пример замены когда много аргументов: ``` In: A and X and B and NOT X and C and X and D Out: A and FALSE and B and C and D ``` Выражение из примера можно преобразовать если X, B и C не требуют побочных эффектов. Или вот пример если B' требует побочных эффектов: ``` In: A and X and B' and NOT X and C and X and D Out: A and X and B' and FALSE and C and D ``` Про что думал, но не стал делать: 1) Можно заменять на константу не только X / NOT X, но и всю цепочку подряд идущих узлов без побочных эффектов. Оставляю это другим оптимизаторам, чтобы меньше думать про нюансы и не дублировать код (в частности чтобы не заботиться о типизации если в цепочке оказался Optional Bool). 2) Можно поддержать опциональные X, тогда будет примерно такое преобразование `X AND NOT X -> IF(X IS NULL, NULL, FALSE)`. Неочевидно что это улучшение и пока решили не делать. Оптимизатор под флагом. Тесты с включением флага тут: [https://nda.ya.ru/t/6YuCsGDE7H8Dnd](https://nda.ya.ru/t/YVdMA5B37H8Dne commit_hash:c34cf075a46c6b06c742ff0b15697b93ede75924
* YQL-20258 side effects infrastructurevvvv2025-08-0118-0/+210
| | | | commit_hash:cb76201226f30679f63457a9f9e1ebdb31dcd05b
* YQL-20209: use Filter+Unessential instead of SkipNullMembers in ↵lucius2025-08-017-0/+140
| | | | | | EmitSkipNullOnPushdown commit_hash:464cfa9be3ee98de47a47ff4e88db5b0d9eb37ec