You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a column named ALL or DISTINCT appears in the first position of the select list in a distributed query, the query fails with Syntax error.
In the rewriten query the column name appears without quotation marks, so remote server interprets DISTINCT as part of SELECT DISTINCT instead of column name. Same thing applies to column named ALL.
:) select"DISTINCT"from dist_t0
SELECT DISTINCTFROM dist_t0
Query id: d9024cf2-777e-4f5e-a7fa-f9d2eb8dc661
0 rows inset. Elapsed: 0.013 sec.
Received exception from server (version 21.11.5):
Code: 62. DB::Exception: Received from localhost:9000. DB::Exception: Received from localhost:9000. DB::Exception: Syntax error: failed at position 22 ('default'): default.t0. Expected one of: UNION, LIMIT, WHERE, WINDOW, DoubleColon, LIKE, GLOBAL NOT IN, end of query, HAVING, AS, DIV, IS, UUID, GROUP BY, INTO OUTFILE, OR, EXCEPT, QuestionMark, OFFSET, BETWEEN, NOT LIKE, MOD, PREWHERE, AND, Comma, alias, ORDER BY, SETTINGS, IN, ILIKE, INTERSECT, FROM, FORMAT, Dot, NOT ILIKE, WITH, NOT, Arrow, token, NOT IN, GLOBAL IN. (SYNTAX_ERROR)
The text was updated successfully, but these errors were encountered:
Describe what's wrong
If a column named
ALL
orDISTINCT
appears in the first position of the select list in a distributed query, the query fails withSyntax error
.In the rewriten query the column name appears without quotation marks, so remote server interprets
DISTINCT
as part ofSELECT DISTINCT
instead of column name. Same thing applies to column namedALL
.Does it reproduce on recent release?
Yes, It reproduces on 21.11.5 official build
How to reproduce
CREATE TABLE
statements for all tables involvedThe text was updated successfully, but these errors were encountered: