v.24.8Improvement

Function mapFromArrays Enhancements: Supports Map as First Argument and Nullable Array Types

Function mapFromArrays now accepts Map(K, V) as first argument, for example: SELECT mapFromArrays(map('a', 4, 'b', 4), ['aa', 'bb']) now works and returns {('a',4):'aa',('b',4):'bb'}. Also, if the 1st argument is an Array, it can now also be of type Array(Nullable(T)) or Array(LowCardinality(Nullable(T))) as long as the actual array values are not NULL. #67103 (李扬).
The mapFromArrays function now supports a Map(K, V) type as its first argument and accepts arrays with nullable or low cardinality nullable types as long as actual values are not NULL.

Why it matters

This enhancement allows users to create maps by using an existing map as the keys array or by using arrays with nullable or low cardinality nullable types, increasing flexibility and usability of the mapFromArrays function in varied data scenarios.

How to use it

You can pass a map as the first argument to mapFromArrays to serve as keys, for example:
SELECT mapFromArrays(map('a', 4, 'b', 4), ['aa', 'bb'])

This will return a map where composite keys from the first map are mapped to corresponding array values. Additionally, you can use arrays of type Array(Nullable(T)) or Array(LowCardinality(Nullable(T))) for the first array argument, provided that none of the values are NULL.