Skip to main content
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

ParameterDescriptionSupported input types
<array>The array whose upper bound should be calculatedARRAY
<int>The dimension to look at, for multi-dimensional arraysINTEGER

Return Type

INTEGER

Example

SELECT
  ARRAY_UPPER([1, 2, 3], 1);
Returns: 3
SELECT
  ARRAY_UPPER([[1], 2, [3, 4]], 1);
Returns: 3
I