- Categories:
MAP_ENTRIES¶
Returns an ARRAY value of key-value pair objects for each entry in a MAP value.
Syntax¶
Arguments¶
mapThe input MAP value.
Returns¶
Returns an ARRAY value where each element is an OBJECT with a key field and a
value field corresponding to an entry in the input MAP value.
If map is NULL, the function returns NULL.
If map is empty, the function returns an empty ARRAY value.
The order of the entries in the returned ARRAY value is undefined.
Usage notes¶
The function accepts exactly one argument. Calling the function with no arguments or more than one argument results in an error.
Examples¶
Return the entries in a MAP value as key-value pair objects:
Return an empty ARRAY value for an empty MAP value:
Return the entries in a MAP where the values are of type ARRAY:
Return NULL for a NULL input: