Returns the maximum index that can be used for an array. Produces NULL for NULL arrays.
Because Firebolt currently does not support array slices, the maximum index is always the length of the array.
This function is currently only implemented for the second parameter being 1.
Syntax
ARRAY_UPPER(<array>, <int>)
Parameters
| Parameter | Description | Supported input types |
|---|
<array> | The array whose upper bound should be calculated | ARRAY |
<int> | The dimension to look at, for multi-dimensional arrays | INTEGER |
Return Type
INTEGER
Examples
SELECT ARRAY_UPPER([1, 2, 3], 1);
Rows: 1Execution time: 5.12ms
SELECT ARRAY_UPPER([[1, 2], [3, 4], [5, 6]], 1);
Rows: 1Execution time: 4.58ms