Slice / List Layer

Extract a contiguous subsequence from each variable-length list using fixed offset and length. Similar to Python's list slicing or R's slice(). Returns a new list containing the specified elements.

Example transformation:

With offset=1, length=2:

listsslice
[1, 2, 3, 4][2, 3]
[a, b, c][b, c]
[x, y][y]
[q][]

With offset=-2, length=2:

listsslice
[1, 2, 3, 4][3, 4]
[a, b, c][b, c]
[x, y][y]
[][]

Common applications:

  • Extracting recent history windows
  • Processing time series segments
  • Creating sliding windows
  • Analyzing sequence patterns
  • Taking list subsets
  • Implementing pagination

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 working with sequential data windows.

Table
0
0
Table

Select

column

The variable-length list column to slice. Examples:

  • Time series: [val1, val2, val3, val4]
  • Event logs: [event1, event2, event3]
  • Message history: [msg1, msg2]
  • Measurements: [1.1, 1.2, 1.3] Lists can have different lengths. Supports any data type.
0

Starting position (Offset) for the slice. Examples:

  • 0: Start from beginning
  • 2: Start from third element
  • -1: Start from last element
  • -2: Start from second-to-last element Supports negative indexing (counting from end)
0

Number of elements (Length) to include in slice. Examples:

  • 0: Take all elements from offset to end
  • 1: Take one element
  • 2: Take two elements Automatically adjusted if extends beyond list bounds

Name 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.