SLICE
Learn how to use the SLICE array function in PlaidCloud Lakehouse. Extracts a slice from the array by index (1-based). Includes syntax and examples.
Extracts a slice from the array by index (1-based).
Analyze Syntax
func.slice( <array>, <start>[, <end>] )
Analyze Examples
func.slice([1, 21, 32, 4], 2, 3)
┌──────────────────────────────────┐
│ func.slice([1, 21, 32, 4], 2, 3) │
├──────────────────────────────────┤
│ [21,32] │
└──────────────────────────────────┘
SQL Syntax
SLICE( <array>, <start>[, <end>] )
Aliases
SQL Examples
SELECT ARRAY_SLICE([1, 21, 32, 4], 2, 3), SLICE([1, 21, 32, 4], 2, 3);
┌─────────────────────────────────────────────────────────────────┐
│ array_slice([1, 21, 32, 4], 2, 3) │ slice([1, 21, 32, 4], 2, 3) │
├───────────────────────────────────┼─────────────────────────────┤
│ [21,32] │ [21,32] │
└─────────────────────────────────────────────────────────────────┘