Document toolboxDocument toolbox

slice

Slice an array with desired begin and end indices.

Usage details

LQL

select *, slice(column, begin, end) as slicedColumn from tableName

Input parameters:

  1. column: A column of type array to be sliced.

  2. begin: The index of array (first being 0) to start slice from.

  3. end: The index of array to end slice at.

Output:

  1. slicedColumn: Sliced array from begin to end where each element is of type string.

Example

Input Table: input_table

Id

list_ts

Id

list_ts

1

WrappedArray(1517348699000, 1517351974000, 1517349002000)

2

WrappedArray(1517349299000)

3

WrappedArray()

LQL

select *, slice(list_ts, 1, 3) as sliced_ts from input_table

id

list_ts

sliced_ts

id

list_ts

sliced_ts

1

WrappedArray(1517348699000, 1517351974000, 1517349002000)

WrappedArray(1517351974000, 1517349002000)

2

WrappedArray(1517349299000)

WrappedArray(1517349299000)

3

WrappedArray()

WrappedArray()