Parameter | Type |
---|---|
array | array |
index | integer |
Returns: any
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,
ELEMENT_AT(cities, 1)
FROM city_array
query:
SELECT country_id,
cities[1]
FROM city_array
results:
country_id | element_at |
---|---|
UK | London |
SG | Singapore |
US | Southlake |
CN | Beijing |
CH | Geneva |
query:
SELECT country_id,
ELEMENT_AT(cities, -1)
FROM city_array
results:
country_id | element_at |
---|---|
UK | Stretford |
SG | Singapore |
US | Seattle |
CN | Beijing |
CH | Bern |