posexplode_outer
table-valued generator function
Returns rows by un-nesting the array with numbering of positions using OUTER
semantics.
Returns
A set of rows composed of the other expressions in the select list, the position of the elements in the array or map, and the elements of the array, or keys and values of the map.
If expr
is NULL
, a single row with NULLs for the array or map values.
The columns produced by posexplode_outer
of an array are named pos
and col
by default, but can be aliased.
You can also alias them using an alias tuple such as AS (myPos, myValue)
.
The columns for maps are by default called pos
, key
, and value
.
You can also alias them using an alias tuple such as AS (myPos, myKey, myValue)
.
You can place posexplode_outer
only in the select list or a LATERAL VIEW
.
When placing the function in the select list there must be no other generator function in the same select list.