array_to_string¶
Description¶
Cast all values in an array to string
and concatenate them, optionally adding a separator between each value.
A null
argument returns a null
result. An array containing any null
values returns a null
result.
Return type¶
string
Domain¶
This is a scalar function (calculates a single output value for a single input row.)
Categories¶
Usage¶
array_to_string(array, sep)
Argument |
Type |
Optional |
Repeatable |
Restrictions |
---|---|---|---|---|
array |
array |
no |
no |
none |
sep |
string |
no |
no |
none |
Examples¶
filter strlen(array_to_string(numbers,'')) > 17
Filter all rows whose numbers
column (an array of integers) contains a total number of digits greater than 17.
make_col messages:array_to_string(data.payload.messages,'-'))
Make the column ‘messages’ by concatenating object array field messages
values, separated by the -
character.
filter strlen(if_null(array_to_string(numbers,''),"") > 17
Filter all rows whose numbers
column (an array of integers) contains a total number of digits greater than 17, checking if the array_to_string
resulted in a null
value and replacing that with the empty string.