ARRAY_LENGTH

If you would like to know the number of items in an array you can use ARRAY_LENGTH.

ParameterType
array
array
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_LENGTH(cities)
  FROM city_array

results:

country_id cities array_length
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