v.21.6Improvement
Implement Generic Array Functions with Enhanced Type Support
Implement functionsarrayHasAny,arrayHasAll,has,indexOf,countEqualfor generic case when types of array elements are different. In previous versions the functionsarrayHasAny,arrayHasAllreturned false andhas,indexOf,countEqualthrown exception. Also add support forDecimaland big integer types in functionshasand similar. This closes #20272. #23044 (alexey-milovidov).
Why it matters
Previously, functions likearrayHasAny 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 applyarrayHasAny, 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.