ClickHouse v24.3+ (including latest lts v24.8 and latest in fiddle v24.10)
Exception:
with
arrayMap(x -> x + 1, [0]) as a
select
1
where
1 in (select arrayJoin(a))
settings allow_experimental_analyzer = 1;
Received exception from server (version 24.10.1):
Code: 1. DB::Exception: Received from localhost:9000. DB::Exception: Resolve identifier 'a' from parent scope only supported for constants and CTE. Actual arrayMap(x -> (x + 1), [0]) AS a node type FUNCTION. In scope (SELECT arrayJoin(a)). (UNSUPPORTED_METHOD)
In my mind this can't be a scope issue because this query works fine:
with
[1] as a
select
1
where
1 in (select arrayJoin(a))
settings allow_experimental_analyzer = 1;
1
And arrayMap(x -> x + 1, [0]) as a is constant (known at the time the SQL query is parsed) and works fine with old analyzer:
with
arrayMap(x -> x + 1, [0]) as a
select
1
where
1 in (select arrayJoin(a))
settings allow_experimental_analyzer = 0;
1
Sample queries:
https://fiddle.clickhouse.com/6a9e9d11-4529-41e2-b7c1-b2c0cbce32dd
ClickHouse v24.3+ (including latest lts v24.8 and latest in fiddle v24.10)
Exception:
In my mind this can't be a scope issue because this query works fine:
And
arrayMap(x -> x + 1, [0]) as ais constant (known at the time the SQL query is parsed) and works fine with old analyzer:Sample queries:
https://fiddle.clickhouse.com/6a9e9d11-4529-41e2-b7c1-b2c0cbce32dd