Scalar function
Returns NULL for a NULL map. NULL map values are retained.
Syntax
Scalar
Arguments
Type notation used below:
- V is the map value type: BOOLEAN, TINYINT, SMALLINT, INTEGER, BIGINT, FLOAT, DOUBLE, DECIMAL(p, s), STRING, BINARY, DATE, TIME, TIMESTAMP, ARRAY, MAP or STRUCT.
Returns
- Type: ARRAY<V>
- Possible values: One value per map entry.
- NULL behavior: Returns NULL for a NULL map. NULL map values are retained.
- Shape: Array length equals map entry count.
- Ordering: Underlying map entry order; no key sorting is performed.
Properties
Usage notes
- INTEGER and INT mean the same type; STRING means VARCHAR text. NULL can be used with a supported type. Cast NULL explicitly when its type would otherwise be unclear.
- For ARRAY-valued keys or values, construct the input map with MAP_FROM_ARRAYS. The ordinary two-argument MAP constructor can interpret ARRAY arguments as parallel key/value lists.
Examples
Typical behavior
String map values
Map entry order is not a general sorting guarantee.
Last modified on October 15, 2026