List Functions
This page lists the list (ListAccum) functions that are available in the GSQL query language.
head()
last()
Description
last()
returns the last element in a list. It is semantically the same as list.get(list.size() - 1)
range()
Description
range()
returns a ListAccum
of integer values within a range bounded by a start value start
and end value end
, and an optional step size step
. The range is inclusive, so the arithmetic progression will always contain start
, and it may contain `end`value, depending on the step size.
Parameters
Parameter |
Description |
Data type |
|
The starting value of the range |
|
|
The ending value of the range |
|
|
(Optional) The difference between any two consecutive values in the range |
|
Example
range(0, 5) -> [0, 1, 2, 3, 4, 5]
range(5, 0, -1) -> [5, 4, 3, 2, 1, 0]
range(2, 18, 3) -> [2, 5, 8, 11, 14, 17]
|