Explode / Array Layer
Convert fixed-length array elements into separate rows. Similar to Polars explode(), pandas explode(), or SQL UNNEST. Creates a new row for each array element, duplicating all other column values.
Example transformation (arrays of length 3):
Input:
id | values |
---|---|
1 | [10, 20, 30] |
2 | [40, 50, 60] |
Output:
id | value |
---|---|
1 | 10 |
1 | 20 |
1 | 30 |
2 | 40 |
2 | 50 |
2 | 60 |
Common applications:
- Normalizing nested data
- Analyzing array elements individually
- Converting arrays to rows
- Time series decomposition
- Tag expansion
Note: Arrays must have the same fixed length across all rows. Null arrays or arrays containing null values produce null rows.
Table
0
0
Table
Select
columnThe fixed-length array column to explode. Supports various array types:
- Numeric arrays: [1, 2, 3]
- String arrays: [a, b, c]
- Date arrays: [2024-01-01, 2024-01-02, 2024-01-03] All arrays must have the same length. Mixed types not supported.
AsColumn
nameName for the new column. If not provided, the system generates a unique name. If AsColumn
matches an existing column, the existing column is replaced. The name should follow valid column naming conventions.