ARRAY_APPEND

The ARRAY_APPEND function is used to append values to an array. As with all array functions the values can be field values, calculated values, literals, or a combination thereof. The only requirement is that all the values are of the same data type. The following is an example of a query using ARRAY_APPEND.

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_APPEND(cities, "foo")
  FROM city_array
In the syntax of the command the array must be listed first followed by the appended value. `ARRAY_APPEND("foo", cities)` would not run.

results:

country_id array_append
UK London, Stretford, foo
SG Singapore, foo
US Southlake, South San Francisco, South Brunswick, Seattle, foo
CN Beijing, foo
CH Geneva, Bern, foo