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

ParameterTypeRequiredDescription
arrayARRAY<T>YesThe array to slice
startBIGINTYesStarting index (0-based, negative counts from end)
endBIGINTYesEnding index (inclusive, negative counts from end)
stepBIGINTNoOptional 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

Examples

Last update at: 2025/10/13 10:23:46