MAP_VALUES
Description
Extracts the values from a given MAP
into an ARRAY
of the corresponding type.
Syntax
MAP_VALUES(<map>)
Parameters
<map>
MAP
type, the input map content.
Return Value
Extracts the values from a given map
into an ARRAY
of the corresponding type.
Usage Notes
- For NULL parameters, returns NULL.
- For empty MAP objects, returns an empty array.
- NULL values in the MAP are also included in the returned array.
Examples
-
Regular parameters
select map_values(map()), map_values(map(1, "100", 0.1, 2, 0.3, null));
+-------------------+----------------------------------------------+
| map_values(map()) | map_values(map(1, "100", 0.1, 2, 0.3, null)) |
+-------------------+----------------------------------------------+
| [] | ["100", "2", null] |
+-------------------+----------------------------------------------+ -
NULL parameters
select map_values(null);
+------------------+
| map_values(null) |
+------------------+
| NULL |
+------------------+