-
Notifications
You must be signed in to change notification settings - Fork 7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Case: column name is equal to function call on existing column #39855
Labels
Comments
EXPLAIN plan :) explain plan actions=1, header=1 select sipHash64(a) from x order by sipHash64(a) EXPLAIN actions = 1, header = 1 SELECT sipHash64(a) FROM x ORDER BY sipHash64(a) ASC Query id: 076231c1-448c-44a8-ad78-d4e711aa7410 ┌─explain────────────────────────────────────────────────────────────┐ │ Expression (Projection) │ │ Header: sipHash64(a) UInt64 │ │ Actions: INPUT :: 0 -> sipHash64(a) UInt64 : 0 │ │ Positions: 0 │ │ Sorting (Sorting for ORDER BY) │ │ Header: sipHash64(a) UInt64 │ │ Sort description: sipHash64(a) ASC │ │ Expression (Before ORDER BY) │ │ Header: sipHash64(a) UInt64 │ │ Actions: INPUT : 0 -> a UInt64 : 0 │ │ FUNCTION sipHash64(a :: 0) -> sipHash64(a) UInt64 : 1 │ │ Positions: 1 │ │ ReadFromMergeTree (default.x) │ │ Header: a UInt64 │ │ ReadType: Default │ │ Parts: 1 │ │ Granules: 1 │ └────────────────────────────────────────────────────────────────────┘ :) explain plan actions=1, header=1 select sipHash64(a) from x order by `sipHash64(a)` EXPLAIN actions = 1, header = 1 SELECT sipHash64(a) FROM x ORDER BY `sipHash64(a)` ASC Query id: 3d694679-cfbd-46fb-9935-d7a1c0e4182c ┌─explain────────────────────────────────────────────┐ │ Expression (Projection) │ │ Header: sipHash64(a) UInt64 │ │ Actions: INPUT :: 0 -> sipHash64(a) UInt64 : 0 │ │ Positions: 0 │ │ Sorting (Sorting for ORDER BY) │ │ Header: sipHash64(a) UInt64 │ │ a UInt64 │ │ Sort description: sipHash64(a) ASC │ │ Expression (Before ORDER BY) │ │ Header: sipHash64(a) UInt64 │ │ a UInt64 │ │ Actions: INPUT :: 0 -> sipHash64(a) UInt64 : 0 │ │ Positions: 0 │ │ ReadFromMergeTree (default.x) │ │ Header: sipHash64(a) UInt64 │ │ a UInt64 │ │ ReadType: Default │ │ Parts: 1 │ │ Granules: 1 │ └────────────────────────────────────────────────────┘ |
Related to #39855. |
The link is on this issue itself |
Related to #23194. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the unexpected behavior
Function in Projection is treated differently, - depending on ORDER BY column
How to reproduce
Expected behavior
I'd expect some consistent behavior or error about ambiguity (don't know how should such case be treated according to SQL standard)
Note: initial example from #38719 discussion, see
The text was updated successfully, but these errors were encountered: