add SELECT ALL syntax#18723
Conversation
src/Parsers/ParserSelectQuery.cpp
Outdated
| has_all = true; | ||
|
|
||
| if (has_all && select_query->distinct) | ||
| throw Exception("Can not use DISTINCT alongside ALL", ErrorCodes::LOGICAL_ERROR); |
There was a problem hiding this comment.
It should be syntax error, not logical error.
| SELECT DISTINCT ALL 1; -- { clientError 49 } | ||
|
|
||
| SELECT sum(number) FROM numbers(10); | ||
| SELECT sum(ALL number) FROM numbers(10); |
There was a problem hiding this comment.
Need to also test that
sum(ALL DISTINCT number)
sum(DISTINCT ALL number)
yields an error.
|
One more detail: we should not throw exceptions from Parser (need to just return false instead). |
There are many |
Not necessarily, there are some useful cases... I will fix Fuzzer in another way. |
|
Now we have to fix the remaining cases: ALL should be treat as identifier. Here ALL should be treat as noop. |
|
Maybe also do the same fixes for DISTINCT: |
But if the query is |
|
It means that the table presumable has a column named |
|
I cannot understand why "Docs check" has failed. Just removed the link. |
I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Add
SELECT ALLsyntax. closes #18706