UNNEST
Written by
Updated at November 6, 2024
Syntax
UNNEST( array )
Description
Expands the array
array expression to a set of rows.
Argument types:
array
—Array of fractional numbers | Array of integers | Array of strings
Return type: Depends on argument types
Note
PostgreSQL
doesn't allow filtering fields containing the UNNEST function. If the data source is PostgreSQL
, do not use such fields in selectors.
Example
Source data
City | Category |
---|---|
'Moscow' |
['Office Supplies', 'Furniture'] |
'London' |
['Office Supplies'] |
Result
[City] | UNNEST([Category]) |
---|---|
'Moscow' |
'Office Supplies' |
'Moscow' |
'Furniture' |
'London' |
'Office Supplies' |
Data source support
ClickHouse 21.8
, Files
, Google Sheets
, PostgreSQL 9.3
, Yandex Documents
.