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
SELECT if(true, null, name) as foo, count(*)
FROM users
GROUP BY foo;
Running this query will result in following error;
Column name is not under aggregate function and not in GROUP BY. Have columns: ['NULL','true','count()']
Query works fine in 23.4. This only happens with const condition in if. After changing true to something that depends on data from table like name is not null query will be executed without any errors.
Expected behavior
Query is valid and should group by result of if (true, null, name).
The text was updated successfully, but these errors were encountered:
den-crane
added
bug
Confirmed user-visible misbehaviour in official release
and removed
potential bug
To be reviewed by developers and confirmed/rejected.
labels
Sep 26, 2023
https://fiddle.clickhouse.com/80c8bea6-1952-499b-91bc-6a08d34355cc
Running this query will result in following error;
Query works fine in 23.4. This only happens with const condition in
if
. After changingtrue
to something that depends on data from table likename is not null
query will be executed without any errors.Expected behavior
Query is valid and should group by result of
if (true, null, name)
.The text was updated successfully, but these errors were encountered: