inline_outer table-valued generator function

Applies to: check marked yes Databricks SQL check marked yes Databricks Runtime

Explodes an array of structs into a table with OUTER semantics.




  • expr: An ARRAY<STRUCT> expression.


A set of rows composed of the other expressions in the select list and the fields of the structs.

If expr is NULL, or the array is empty a single row with nulls for the attributes is produced.

inline can only be placed 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.

The columns produced by inline_outer are named “col1”, “col2”, etc by default, but can be aliased using an alias tuple such as AS (myCol1, myCol2).


> SELECT inline_outer(array(struct(1, 'a'), struct(2, 'b')));
 1  a
 2  b