Last / Array Layer
Extract the last element from each fixed-length array. Similar to array[-1] indexing in Python or tail(1) in R.
Example transformation (arrays of length 3):
arrays | last |
---|---|
[1, 2, 3] | 3 |
[x, y, z] | z |
[true, false, true] | true |
[1, null, 3] | 3 |
Common applications:
- Getting final values
- Extracting last states
- Processing end elements
- Accessing terminal values
Note: All arrays must have the same fixed length. Preserves original element type.
Table
0
0
Table
Select
columnThe fixed-length array column to access. All arrays must have same length:
- Numeric arrays: [1, 2, 3]
- String arrays: [x, y, z]
- Boolean arrays: [true, false, true]
- Date/time arrays: [2024-01-01, 2024-01-02, 2024-01-03]
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.