| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
commit_hash:c106c0b4122e4493aa70f0007e98dff850405f05
|
|
|
|
| |
commit_hash:9199da15c695cf5c8a492750a8bcfbb0f31c0b34
|
|
|
|
|
|
| |
- Ignored 2 known ambiguities.
- Tested tools.
commit_hash:9e29bb2f876dabc68293b3e5c26a470d373506ae
|
|
|
|
| |
commit_hash:c3c929f4005b33d2fddb492bbc2c553125d9ad40
|
|
|
|
|
|
|
|
|
|
|
| |
- 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
|
|
|
|
| |
commit_hash:a9a24e2156ccebef387f026b91efcd5628389146
|
|
|
|
|
|
|
| |
usage
types
commit_hash:6214c6a10f057439898414592a7b70a178ef14a1
|
|
|
|
|
| |
So now both `AsTable` and `AS_TABLE` work.
commit_hash:ae8c33f44e7b10de02a9d979373f4b0602ff0b12
|
|
|
|
|
| |
init
commit_hash:11d97d8b3cbe39684d0813f20fdba59085a2e265
|
|
|
|
|
| |
init
commit_hash:fee9a86a1f95e9271bf49205dad4b6eb0b934dec
|
|
|
|
| |
commit_hash:96e8a09d23befb758e60a6e01f691868331af968
|
|
|
|
|
| |
init
commit_hash:479f16e9cd255b616573d811910403290f9ef656
|
|
|
|
|
| |
init
commit_hash:ededd246fa929931de6e89fd5f809157d9fe4d16
|
|
|
|
|
| |
без langver, т.к. может быть использована для починки оптимизаторов, где при раскрытии List-ов из воздуха рождается Iterator а потом все заканчивается Collect
commit_hash:21cb9b9454cb255b476d50bdb8c5db150cd773fd
|
|
|
|
| |
commit_hash:ffdf6d88b491ce35a3a038c387250bf3a005ebbc
|
|
|
|
| |
commit_hash:3d0e8bfb46470e6ac36b0d198cfa1723c665f643
|
|
|
|
|
| |
init
commit_hash:1c72053b3785a26cfde418f28a9d054b5a624627
|
|
|
|
| |
commit_hash:70c91e881d5f8126d3d1c68a5816f440295330da
|
|
|
|
| |
commit_hash:dbf1a2fd200d2699cbc984fd4da357fb79ca3bd9
|
|
|
|
| |
commit_hash:f29316d37138b6555b2d09a4c67aeef3b447ea60
|
|
|
|
| |
commit_hash:832d6963d7f12d5ff8da09d883801e65857acaca
|
|
|
|
| |
commit_hash:c2440ce49cc8c7637134ddf8081b32251ff75fd4
|
|
|
|
| |
commit_hash:031b3f5c4215bc9c66d0cea9c8dd8d69a1ec1627
|
|
|
|
|
|
|
|
|
|
|
| |
Also added tests for:
- max_by
- agg_list
- some
- avg_if
- sum_if
- count_if
commit_hash:0da4f3b9b1767850e65c914b727bc362cf4cc125
|
|
|
|
|
| |
Follows up ydb-platform/ydb@34fcd78a2d18d9846fd68339c8e240702857e1e5
commit_hash:08520ae8b837c69f6b92e575882da4786aa441fd
|
|
|
|
| |
commit_hash:a8645f7215087df3309048de31a7f0b3dc802a11
|
|
|
|
| |
commit_hash:7007950c8dbbf4d1c8edd5c275eaea723e29e56b
|
|
|
|
| |
commit_hash:39b07bbc84e57d9df02c839273366c28442b789f
|
|
|
|
|
|
| |
There was an issue that a query with warnings
as errors passed translation.
commit_hash:890d18853380b5ad669e9684553cdb6991827cff
|
|
|
|
| |
commit_hash:27dc40f323e5d24af0dae4f3917a63248f8f8386
|
|
|
|
| |
commit_hash:ad0cc5722938a8e337f7bc9b5f4a631a299c6a99
|
|
|
|
|
|
| |
Added absent checks for `langVer` at `EXCEPT/INTERSECT/DISTINCT`
translation. In next PR will get rid of `.sqlx` file extensions.
commit_hash:699cc8f6084d1d2fc19ecd53c35a56496dc842f4
|
|
|
|
| |
commit_hash:ffcc5347cf91200515e45d7442de193e20d6edcd
|
|
|
|
| |
commit_hash:4b93115d4e3d46770946a7a462c7413d6183282f
|
|
|
|
|
| |
init
commit_hash:7169a3cfe8408c4baff8524a8022b5b219900b94
|
|
|
|
|
| |
Support `FLATTEN [OPTIONAL] BY` for any data type
commit_hash:6fb221fadf29d1dcc7ea4590a21c115fc506aa51
|
|
|
|
| |
commit_hash:8ca485c564bd7f0ff3ce9685470a06e07e99d0f4
|
|
|
|
|
| |
YQL-20150: Add OptimizeLMap optimizer
commit_hash:065921d83e492d815fa95f3e9bedd006aee0c887
|
|
|
|
| |
commit_hash:45d5b2e2dd994307de6d103f3b9658f40fd3696b
|
|
|
|
| |
commit_hash:44e30306b80ccb5f73f3fc9ab17545e0af3b413f
|
|
|
|
| |
commit_hash:e6cca97ec9c9627f1ba82a11abf454518fc90972
|
|
|
|
| |
commit_hash:ed91bc01a9eb89e8817a6441ee293bf98524290c
|
|
|
|
| |
commit_hash:5b0aadf271c553415c536606ff7f52575bd267c4
|
|
|
|
|
|
|
|
|
|
|
| |
Добавляю поддержку фильтрации нуллов при пушдауне на необязательную сторону джоина (до этого она работала только при пушдауне на обязательную сторону).
Как в пушдауне предиката с левой стороны одновременно на правую (PredicatePushdownOverEquiJoinBothSides), так и в пушдауне сразу на правую (FilterPushdownOverJoinOptionalSide).
Включается по флагу PredicatePushdownOverEquiJoinBothSides.
Тесты с включением можно посмотреть тут: <https://nda.ya.ru/t/e2f09Qw_7HNvu6>
commit_hash:0f101bfced2a510995577e1bca90eef6d2505992
|
|
|
|
| |
commit_hash:4ee9d9b9079b90e8eeb91accc41d6a3a30c3a18c
|
|
|
|
| |
commit_hash:1753b28fb549f00ea6ed88d12d64ac9c9ddaddd5
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Делает возможным такие оптимизации:
- `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
|
|
|
|
| |
commit_hash:cb76201226f30679f63457a9f9e1ebdb31dcd05b
|
|
|
|
|
|
| |
EmitSkipNullOnPushdown
commit_hash:464cfa9be3ee98de47a47ff4e88db5b0d9eb37ec
|