> ## Documentation Index
> Fetch the complete documentation index at: https://docs.e6data.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ARRAY

> Constructs an array from expressions.

Scalar function

NULL input values become NULL elements; the constructed array is non-NULL.

## Syntax

### Scalar

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
array([value [, ...]])
```

## Arguments

| Name | Type | Required | Description |
| - | - | - | - |
| value | BOOLEAN, TINYINT, SMALLINT, INTEGER, BIGINT, FLOAT, DOUBLE, DECIMAL(p, s), STRING, BINARY, DATE, TIME, TIMESTAMP, ARRAY, MAP or STRUCT | No | One element; more compatible values can follow. For DECIMAL(p, s), p is precision (total digits) and s is scale (digits after the decimal point). This argument can repeat. |

## Returns

* Type: ARRAY\<T>
* Possible values: The values converted to a common element type.
* NULL behavior: NULL input values become NULL elements; the constructed array is non-NULL.
* Shape: T is the common SQL type of the value arguments: BOOLEAN, TINYINT, SMALLINT, INTEGER, BIGINT, FLOAT, DOUBLE, DECIMAL(p, s), STRING, BINARY, DATE, TIME, TIMESTAMP, ARRAY, MAP or STRUCT. All concrete arguments must have this type after type conversion; the result preserves nested element and field types.
* Ordering: Argument order.

## Properties

| Property | Value |
| - | - |
| Deterministic | Yes |
| Supports window usage | No |
| Exact result | Yes |

## Usage notes

* With no arguments, the result is an empty ARRAY\<NULL>. NULL-only inputs produce NULL elements. When a typed value is present, NULL elements take that value’s type. Nested arrays remain separate array elements; they are not joined together.
* INTEGER and INT mean the same type; STRING means VARCHAR text. NULL can be used with a supported type. Cast NULL explicitly when its type would otherwise be unclear.

## Examples

### Typical behavior

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT array(1, NULL, 2) AS "value";
```

| value |
| - |
| \[1,null,2] |

### Create an empty array

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT array() AS result;
```

| result |
| - |
| \[] |

## Limitations

* All non-NULL values must have compatible types. Use explicit casts for mixed numeric types. Cast NULL to a specific type when you need a predictable array element type.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.