concat_arrays¶
Description¶
Returns a concatenation of N arrays array1
, array2
, …, arrayN
.
Note that this function accepts both ARRAY type and VARIANT type.
Note that items of VARIANT type that are not actually ARRAYs will be skipped.
Null values will also be skipped.
Return type¶
array
Domain¶
This is a scalar function (calculates a single output value for a single input row.)
Categories¶
Usage¶
concat_arrays( [ arrays ] ... )
Argument |
Type |
Required |
Multiple |
---|---|---|---|
arrays |
variable |
Optional |
Can be multiple |
Examples¶
make_col foo:concat_arrays(make_array(1, 2), make_array(3), make_array("abc"))
Creates a column foo
with an array that contains the concatenation of all
items in the input arguments, e.g., [1, 2, 3, “abc”].
make_col foo:concat_arrays(make_array(1, 2), bar, baz, data)
Assume that bar is a variant that wraps the array [3]. Assume that baz is a variant that wraps a string “str”. Assume that data is a NULL array.
Creates a column foo
with an array that contains the concatenation of all items in the input arguments, e.g., [1, 2, 3].
Content of bar
is picked as it is actually an array.
baz
is skipped as it is not an array.
data
is also skipped, as it is null.