v.24.5New Feature
Maps Support Additional Key Types in ClickHouse
Maps can now haveFloat32,Float64,Array(T),Map(K, V)andTuple(T1, T2, ...)as keys. Closes #54537. #59318 (李扬).
Why it matters
This feature extends the flexibility and usability of theMap data type by allowing more complex and varied key types beyond the previously supported ones. It enables users to create richer data structures and perform more advanced queries by using complex key types in maps.How to use it
Users can defineMap columns with the newly supported key types directly in their table schemas or queries, for example:CREATE TABLE example (
id Int32,
data Map(Float64, String)
) ENGINE = MergeTree() ORDER BY id;This allows you to use floating point numbers, arrays, maps, or tuples as keys in maps without any additional configuration.