length elements from input from the position specified by offset.
Syntax
Parameters
-
input: the array whose slice you want to intercept. This function supports the following types of array elements: BOOLEAN, TINYINT, SMALLINT, INT, BIGINT, LARGEINT, FLOAT, DOUBLE, VARCHAR, DECIMALV2, DATETIME, DATE, and JSON. JSON is supported from 2.5. -
offset: the position from which to intercept elements. Valid values start from1. It must be a BIGINT value. -
length: the length of the slice that you want to intercept. It must be a BIGINT value.
Return value
Returns an array that have the same data type as the array specified by theinput parameter.
Usage notes
- The offset starts from 1.
- If the specified length exceeds the actual number of elements that can be intercepted, all the matching elements are returned. See Example 4.