ClickHouse: Logical error: Not-ready Set is passed

clickhouse-local --multiquery "
CREATE TABLE t (item_id UInt64, price_sold Nullable(Float32), date Date) ENGINE = MergeTree ORDER BY item_id;

SELECT * FROM (SELECT item_id FROM t GROUP BY item_id WITH TOTALS ORDER BY '922337203.6854775806' IN (SELECT NULL) ASC, [NULL, -2, NULL, NULL] ASC NULLS FIRST, item_id ASC NULLS LAST) AS l RIGHT JOIN (SELECT item_id FROM t) AS r ON l.item_id = r.item_id WHERE NULL IN (SELECT NULL);
"

About this issue

  • Original URL
  • State: open
  • Created a year ago
  • Comments: 24 (22 by maintainers)

Commits related to this issue

Most upvoted comments

More:

SELECT compression_codec
FROM system.columns
WHERE exists(
    SELECT 1
)
SELECT xor(1, 0)
FROM system.parts
WHERE 1 IN (
    SELECT 1
)

Another one, with a Merge table and a distributed query. 24.2+ https://fiddle.clickhouse.com/4f181521-8538-4a38-81b8-a64777db1d75

create table t1 (
  key Int32,
  value Float32
) engine=MergeTree order by tuple();

insert into t1 values (12, 22);
create table t2 as t1;
insert into t2 select * from t1;

create table m as t1 engine=Merge('default','^t');

select sum(value)
from remote('localhost,localhost,',default.m)
where key in (select * from system.one)

Received exception from server (version 24.3.1):
Code: 49. DB::Exception: Received from localhost:9000. DB::Exception: Not-ready Set is passed as the second argument for function 'in': while executing 'FUNCTION in(key : 0, _subquery1 :: 1) -> in(key, _subquery1) UInt8 : 2': While executing MergeTreeSelect(pool: ReadPoolInOrder, algorithm: InOrder). (LOGICAL_ERROR)
(query: select sum(value)
from remote('localhost,localhost,',default.m)
where key in (select * from system.one)
)