inline table-valued generator function

Explodes an array of structs into a table.




  • 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 no rows are 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 are named “col1”, “col2”, etc by default, but can be aliased using an alias tuple such as AS (myCol1, myCol2).


> SELECT inline(array(struct(1, 'a'), struct(2, 'b'))), 'Spark SQL';
 1  a Spark SQL
 2  b Spark SQL