ARRAY_PREPEND

Similar to ARRAY_APPEND, ARRAY_PREPEND adds values to an array. Because the array always has to come first in the command, this function allows you to specify the output order.

ParameterType
array
array
element
any
Returns: array

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,
       ARRAY_PREPEND(cities, "foo")
  FROM city_array

results:

country_id array_prepend
UK foo, London, Stretford
SG foo, Singapore
US foo, Southlake, South San Francisco, South Brunswick, Seattle
CN foo, Beijing
CH foo, Geneva, Bern
BR foo, Sao Paulo
NL foo, Utrecht