Array Constructor
Applies to: ✅ Data 360 SQL ✅ Tableau Hyper API
Creates an array from a comma-separated list of values.
<element1>, <element2>, ..., <elementN>: Values to include in the array. All elements must be of compatible types that can be coerced to a common element type.
Returns an ARRAY that contains the specified elements. Data 360 SQL automatically infers the array type from the provided elements.
- All array elements must be of compatible types.
- Elements can be literals, column references, or expressions.
- Empty arrays can be created with
ARRAY[]. - Arrays can contain
NULLvalues. - Type coercion applies when elements are of different but compatible types.
- If no
nullvalues are in the constructor, Data 360 SQL infers the element type asnot null. - Arrays are limited to 4 GB in size
- Arrays cannot be nested (see Array Type).
Create a simple array of numeric values.
Returns [1,2,3,4,5]
Create an array from string literals.
Returns ["apple","banana","cherry"]
Create an array from multiple columns in a query.
Use expressions within the array constructor.
Create an empty array with an explicit integer type.
Returns []
Arrays can contain NULL elements.
Returns [1,NULL,3,NULL,5]
When elements are of different but compatible types, automatic type coercion occurs.
Returns [1.0,2.5,3.0] - all elements coerced to decimal type.
- Array Data Type - Complete documentation on array types including constructor syntax
- Array Functions - Overview of all array functions
ARRAY_GENERATE_SERIES- Generate arrays programmatically- Type Conversion - Type casting and coercion