v.20.3Improvement

Allow Constant Functions and Arrays with IN Operator

Allow constant functions and constant arrays to be used on the right side of IN operator. #8813 (Anton Popov)
Allows constant functions and constant arrays to be used on the right side of the IN operator in ClickHouse queries.

Why it matters

This feature enables more flexible and expressive query conditions by permitting constant expressions and arrays on the right-hand side of the IN operator, which previously might have been unsupported or limited. This improves query writing convenience and can simplify query logic.

How to use it

Simply use constant functions or constant arrays as the right operand in the IN clause in your SQL queries. For example:

SELECT  FROM table WHERE column IN ([1, 2, 3])

or

SELECT  FROM table WHERE column IN (arrayMap(x -> x * 2, [1, 2, 3]))