Converts key-value pairs in Map a into a struct array.

Syntax

array<struct<K, V>> map_entries(map<K, V> <a>): 

Parameters

a: required. This parameter specifies a map. K and V in map<K, V> specify the keys and values of a map.

Return value

A struct array is returned. If the input is null, NULL is returned.

Example

-- [{key:1, value:a}, {key:2, value:b}] is returned. 
select map_entries(map(1,  'a',  2,  'b'));