ARRAY_UPPER

Use ARRAY_UPPER to find the upper bounds of an array's indices for a given dimension.

ParameterType
array
array
index
integer
Returns: int

Example

Arrays are currently only supported on tables from a live connection to an Athena database. You cannot use them with other databases or with tables derived from an Athena database.

query:

SELECT country_id,
       cities,
       ARRAY_UPPER(cities, 1)
  FROM city_array

results:

country_id cities array_upper
UK London, Stretford 2
SG Singapore 1
US Southlake, South San Francisco, South Brunswick, Seattle 4
CN Beijing 1
CH Geneva, Bern 2
BR Sao Paulo 1