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

# Array functions

> BigQuery array functions and array handling in BigQuery compatibility mode.

<span className="feature-tag">Preview</span>

BigQuery [array functions](https://docs.cloud.google.com/bigquery/docs/reference/standard-sql/array_functions) in [BigQuery compatibility mode](/compatibility-modes/bigquery/overview). See also the Firebolt [Arrays guide](/guides/sql-dialect/arrays).

| Function                                                                                                                                  | Support          | Notes                                                                                                    |
| :---------------------------------------------------------------------------------------------------------------------------------------- | :--------------- | :------------------------------------------------------------------------------------------------------- |
| [`ARRAY`](https://docs.cloud.google.com/bigquery/docs/reference/standard-sql/array_functions#array)                                       | Supported        | Array subquery and constructor.                                                                          |
| [`UNNEST`](https://docs.cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax#unnest_operator)                               | Supported        | Table-valued. Expands an array to rows, including `WITH OFFSET AS alias`.                                |
| [`ARRAY_CONCAT`](https://docs.cloud.google.com/bigquery/docs/reference/standard-sql/array_functions#array_concat)                         | Supported        |                                                                                                          |
| [`ARRAY_LENGTH`](https://docs.cloud.google.com/bigquery/docs/reference/standard-sql/array_functions#array_length)                         | Supported        |                                                                                                          |
| [`ARRAY_FIRST`](https://docs.cloud.google.com/bigquery/docs/reference/standard-sql/array_functions#array_first)                           | Supported        |                                                                                                          |
| [`ARRAY_REVERSE`](https://docs.cloud.google.com/bigquery/docs/reference/standard-sql/array_functions#array_reverse)                       | Supported        |                                                                                                          |
| [`ARRAY_TO_STRING`](https://docs.cloud.google.com/bigquery/docs/reference/standard-sql/array_functions#array_to_string)                   | Supported        |                                                                                                          |
| [`ARRAY_SLICE`](https://docs.cloud.google.com/bigquery/docs/reference/standard-sql/array_functions#array_slice)                           | With limitations | Firebolt indexes by offset and length, whereas BigQuery uses start and end positions, so results differ. |
| [`GENERATE_ARRAY`](https://docs.cloud.google.com/bigquery/docs/reference/standard-sql/array_functions#generate_array)                     | Supported        |                                                                                                          |
| [`GENERATE_DATE_ARRAY`](https://docs.cloud.google.com/bigquery/docs/reference/standard-sql/array_functions#generate_date_array)           | With limitations | Step must be a whole number of days.                                                                     |
| [`ARRAY_LAST`](https://docs.cloud.google.com/bigquery/docs/reference/standard-sql/array_functions#array_last)                             | Not supported    |                                                                                                          |
| [`GENERATE_TIMESTAMP_ARRAY`](https://docs.cloud.google.com/bigquery/docs/reference/standard-sql/array_functions#generate_timestamp_array) | Not supported    |                                                                                                          |

## Array construction and access

| Construct                               | Notes                                |
| :-------------------------------------- | :----------------------------------- |
| `[e1, e2, ...]`                         | Array literal.                       |
| `ARRAY<T>[e1, e2, ...]`                 | Typed array literal.                 |
| `array[OFFSET(n)]`, `array[ORDINAL(n)]` | Element access, 0-based and 1-based. |

BigQuery arrays cannot contain `NULL` elements. Firebolt allows them, so a `NULL` element does not raise the error BigQuery would. See [Data types](/compatibility-modes/bigquery/data-types).
