Explode / List Layer
Convert list elements into separate rows. Similar to Polars explode(), pandas explode(), or SQL UNNEST. Creates a new row for each list element, duplicating all other column values. Supports lists of different lengths.
Example transformation:
Input:
id | values |
---|---|
1 | [10, 20, 30] |
2 | [40, 50] |
3 | [60] |
4 | [] |
Output:
id | value |
---|---|
1 | 10 |
1 | 20 |
1 | 30 |
2 | 40 |
2 | 50 |
3 | 60 |
Common applications:
- Expanding variable-length transaction histories
- Analyzing user interaction sequences
- Converting nested JSON data to tabular format
- Processing event logs with multiple entries
- Analyzing social media engagement patterns
- Expanding multi-value attributes
Note: Lists can have any length, including empty. Empty lists produce no rows. Lists containing null values produce rows with null values. Particularly useful for normalizing nested data with varying numbers of elements.
Select
columnThe variable-length list column to explode. Supports various types:
- Numeric lists: [1, 2, 3, 4, 5]
- String lists: [comment1, comment2]
- Date lists: [2024-01-01, 2024-01-02, 2024-01-03]
- Mixed length examples: [1, 2], [1, 2, 3], [1] Lists can have different lengths. 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.