v.22.2Improvement

Added support for casting from Map to Array of Tuples in ClickHouse

Added support for cast from Map(Key, Value) to Array(Tuple(Key, Value)). #33794 (Maksim Kita).
Added support for casting from Map(Key, Value) to Array(Tuple(Key, Value)) in ClickHouse.

Why it matters

This feature enables users to convert Map data types into an Array of Tuple pairs, facilitating easier manipulation and processing of map entries as array elements. It improves interoperability and data transformation flexibility within queries.

How to use it

Users can apply this feature by using the CAST expression to convert a Map(Key, Value) column or expression to Array(Tuple(Key, Value)), for example:

SELECT CAST(your_map_column AS Array(Tuple(KeyType, ValueType))) FROM your_table;