array function

Applies to: check marked yes Databricks SQL check marked yes Databricks Runtime 11.3 LTS and above

Returns an array with the elements in expr.


array(expr [, ...])


  • exprN: Elements of any type that share a least common type.


An array of elements of exprNs least common type.

If the array is empty or all elements are NULL the result type is an array of type null.


-- an array of integers
> SELECT array(1, 2, 3);
-- an array of strings
> SELECT array(1.0, 1, 'hello');