ARRAY_JOIN

This is the function to use if you want to concatenate all the values in an array field into one string value. You can specify an optional argument as a separator, and it can be any string. If you do not specify a separator, there will be nothing aded between the values. In this example we chose to use a forward slash.

ParameterTypeDescription
array
array
separator
string
optional
Returns: string

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_JOIN(cities, "/")
  FROM city_array

results:

country_id array_concat
UK London/Stretford
SG Singapore
US Southlake/South San Francisco/South Brunswick/Seattle
CN Beijing
CH Geneva/Bern
BR Sao Paulo