SLICE_END
All functions > ARRAY > SLICE_END
Returns a slice of an array using SQL-like start:end:step semantics.
Syntax
SLICE_END(array: ARRAY<T>, start: BIGINT, end: BIGINT, step: BIGINT) → ARRAY<T>
sql
Type Parameters:
T
: Any type
Arguments
Parameter | Type | Required | Description |
---|---|---|---|
array | ARRAY<T> | Yes | The array to slice |
start | BIGINT | Yes | Starting index (0-based, negative counts from end) |
end | BIGINT | Yes | Ending index (inclusive, negative counts from end) |
step | BIGINT | No | Optional step value (default: 1, can be negative) |
Returns
ARRAY<T>
- Sliced portion of the array
Notes
- Uses Python-like slicing with inclusive end index
- Supports negative indices for counting from the end
- Optional step parameter for skipping elements
- Negative step creates reversed slices
- Returns empty array if indices are out of range