v.21.6Improvement

Implement Generic Array Functions with Enhanced Type Support

Implement functions arrayHasAny, arrayHasAll, has, indexOf, countEqual for generic case when types of array elements are different. In previous versions the functions arrayHasAny, arrayHasAll returned false and has, indexOf, countEqual thrown exception. Also add support for Decimal and big integer types in functions has and similar. This closes #20272. #23044 (alexey-milovidov).
Enhanced array functions to support heterogeneous element types and additional numeric types.

Why it matters

Previously, functions like arrayHasAny and arrayHasAll would return false, and has, indexOf, and countEqual would throw exceptions when used on arrays with elements of different types. This feature fixes those limitations, enabling these functions to work correctly with arrays containing mixed element types. It also adds support for Decimal and big integer types in has and related functions. This improvement increases the flexibility and robustness of array operations in ClickHouse.

How to use it

Users can now directly apply arrayHasAny, arrayHasAll, has, indexOf, and countEqual functions on arrays that contain elements of different types without errors. No additional configuration is needed; these functions will automatically handle heterogeneous arrays and support Decimal and big integer types.