SliceMixed / List Layer
Extract a contiguous subsequence from each variable-length list using dynamic offset and length values. Similar to Python's list slicing but with per-row control. Returns a new list containing the specified elements.
Example transformation:
lists | offset | length | result |
---|---|---|---|
[1, 2, 3, 4] | 1 | 2 | [2, 3] |
[a, b, c] | -2 | 2 | [b, c] |
[x, y, z] | 0 | 1 | [x] |
[q, r] | 1 | 0 | [r] |
Common applications:
- Dynamic window selection
- Conditional sequence extraction
- Variable-length history analysis
- Adaptive time series processing
- Flexible range selection
- Context-dependent slicing
Note: Lists can have any length. Returns empty list if offset is out of bounds. Length is automatically adjusted if it extends beyond list bounds. Particularly useful for data-driven sequence analysis.
Select
columnThe variable-length list column to slice. Examples:
- Time series: [t1, t2, t3, t4]
- User actions: [click1, click2, click3]
- Transactions: [tx1, tx2] Lists can have different lengths. Supports any data type.
Offset
oneofSelectOffset
columnColumn containing starting positions. Each row can specify a different offset. Supports both positive and negative values.
FixedOffset
i64Fixed starting position for all slices. Supports negative indexing.
Length
oneofSelectLength
columnColumn containing slice lengths. Each row can specify a different length. Use 0 to take all remaining elements.
FixedLength
i64Fixed number of elements to take for all slices. Use 0 to take all remaining elements.
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.