Skip to content

Latest commit

 

History

History
25 lines (19 loc) · 679 Bytes

File metadata and controls

25 lines (19 loc) · 679 Bytes
description
Explodes compound values into multiple rows. This function takes a LIST column and produces a lateral view (that is, an inline view that contains correlation referring to other tables that precede it

FLATTEN

Syntax

FLATTEN(expression list) → list

  • expression: The expression that will be unpacked into rows. The expression must be of data type LIST.

Examples

{% code title="FLATTEN example" %}

SELECT FLATTEN(CONVERT_FROM ('["Ford", "BMW", "Fiat"]', 'json'))
-- Ford
-- BMW
-- Fiat

{% endcode %}