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
{{ message }}
Repository navigation
"Unknown identifier" when executing query with repeating aliases #17319
bugConfirmed user-visible misbehaviour in official releasecomp-joinsJOINs end-to-end (planning hooks + runtime join operators/algorithms). Single bucket to avoid pla...
Tested on server versions from 20.4.6 to 20.11.3.3.
Given table:
create temporary table hits (dateDate, data Float64) engine=Memory();
The following query (note that data alias exists as column in a table, in a subquery and in the outer query):
SELECTsubquery1.periodAS period,
if(1=1, 0, subquery1.data1) AS data,
if(1=1, 0, subquery2.data) AS other_data
FROM
(
SELECTdateAS period, data AS data1
FROM hits
) AS subquery1
LEFT JOIN
(
SELECTdateAS period, data AS data
FROM hits
) AS subquery2 ON (subquery1.period=subquery2.period)
Fails with message:
Code: 47. DB::Exception: Received from localhost:9000. DB::Exception: Unknown identifier: data there are columns: period, data1, 1, equals(1, 1), 0, if(equals(1, 1), 0, data1): While processing period AS period, if(1 = 1, 0, data1) AS data, if(1 = 1, 0, data) AS other_data.
Interestingly, if you just swap the order of lines in the outer query:
if(1=1, 0, subquery2.data) AS other_data,
if(1=1, 0, subquery1.data1) AS data
bugConfirmed user-visible misbehaviour in official releasecomp-joinsJOINs end-to-end (planning hooks + runtime join operators/algorithms). Single bucket to avoid pla...
Activity
den-crane commentedon Nov 23, 2020
related #14978 #13210
alexey-milovidov commentedon Jun 17, 2021
Reproduced on master.
adrian17 commentedon Feb 21, 2024
FYI, this is still reproducible (we have special hacks in queries just to get around this, I was checking if we could possibly remove them).
den-crane commentedon Feb 21, 2024
@adrian17 it's solved in the experimental_analyzer, eventually experimental_analyzer will be released.
https://fiddle.clickhouse.com/560e1440-3232-4d4f-b57f-e14f271a723c
Close: #17319