slice

Slice an array.

Slice an array with desired begin and end indices.

Usage Details

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

Idlist_ts
1WrappedArray(1517348699000, 1517351974000, 1517349002000)
2WrappedArray(1517349299000)
3WrappedArray()
select *, slice(list_ts, 1, 3) as sliced_ts from input_table
idlist_tssliced_ts
1WrappedArray(1517348699000, 1517351974000, 1517349002000)WrappedArray(1517351974000, 1517349002000)
2WrappedArray(1517349299000)WrappedArray(1517349299000)
3WrappedArray()WrappedArray()

© Devo Technology Inc. All Rights Reserved.