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
v23.3.13.6-lts Unexpected behaviour : NOT FOUND COLUMN IN BLOCK exception #55466
Describe the unexpected behaviour
I got an unexpected result when executing a query: NOT_FOUND_COLUMN_IN_BLOCK
How to reproduce
Which ClickHouse server version to use
v23.3.13.6-lts
CREATE TABLE statements for all tables involved
create table default.TEST_NOT_FOUND_COLUMN_IN_BLOCK as default.TEST_NOT_FOUND_COLUMN_IN_BLOCK_merge Engine=Distributed(cluster_test,default,TEST_NOT_FOUND_COLUMN_IN_BLOCK_merge,rand());
create table default.TEST_NOT_FOUND_COLUMN_IN_BLOCK_merge (ID Nullable(String)) Engine= MergeTree() order by tuple() settings use_metadata_cache=true;
insert into TEST_NOT_FOUND_COLUMN_IN_BLOCK values('a'),('b'),('c')
Queries to run that lead to unexpected result
SELECT multiIf( (multiIf((ID is null) AND ((ID = 'a') OR (ID = 'c') OR (ID = 'b')), 'a', CAST(NULL, 'Nullable(String)')) = 'c') OR
(multiIf((ID is null) AND ((ID = 'a') OR (ID = 'c') OR (ID = 'b')),'a',CAST(NULL, 'Nullable(String)')) ='b') OR
(multiIf((ID is null) AND ((ID = 'a') OR (ID = 'c') OR (ID = 'b')), 'a', CAST(NULL, 'Nullable(String)')) = 'd') OR
(multiIf((ID is null) AND ((ID = 'a') OR (ID = 'c') OR (ID = 'b')), 'a', CAST(NULL, 'Nullable(String)')) = 'e'),
'test', CAST(NULL, 'Nullable(String)')) AS alias,
AVG(1) AS avg_temp_alias
FROM TEST_NOT_FOUND_COLUMN_IN_BLOCK
GROUP BY alias
Expected behavior
It should perform properly and produce results.
Additional context
This is the reproduction SQL statement after my anonymization. It may look strange.
I have tested that the problem cannot be reproduced when multiple shards are specified for a single server. The problem can be reproduced only when more than two servers are sharded.
Activity
den-crane commentedon Oct 10, 2023
works with analyzer https://fiddle.clickhouse.com/47c331d8-e8e5-444c-ade0-3443db2b674b
h1k commentedon Oct 25, 2023
Thank you for your support, but set allow_experimental_analyzer=1 will affect my other queries. Is there any plan to fix this problem?
Close: #55466