ARRAY type

Represents values comprising a sequence of elements with the type of elementType.

Syntax

ARRAY < elementType >
  • elementType: Any data type defining the type of the elements of the array.

Limits

The array type supports sequences of any length greater or equal to 0.

Literals

See array function for details on how to produce literal array values.

Examples

> SELECT ARRAY(1, 2, 3);
  [1, 2, 3]
> SELECT CAST(ARRAY(1, 2, 3) AS ARRAY<TINYINT>);
  [1, 2, 3]
> SELECT typeof(ARRAY());
  ARRAY<NULL>
> SELECT CAST(ARRAY(ARRAY(1, 2), ARRAY(3, 4))
              AS ARRAY<ARRAY<BIGINT>>)
  [[1, 2], [3, 4]]