- Categories:
MAP_KEYS¶
Returns the keys in a MAP.
Syntax¶
MAP_KEYS( <map> )
Arguments¶
map
The input map.
Returns¶
Returns a structured ARRAY containing the keys in the MAP. The order of the keys is undefined.
Examples¶
List the keys in a map:
SELECT MAP_KEYS({'a':1,'b':2,'c':3}::MAP(VARCHAR,NUMBER))
AS map_keys;
+----------+
| MAP_KEYS |
|----------|
| [ |
| "a", |
| "b", |
| "c" |
| ] |
+----------+