---
title: ARRAY type
description: The ARRAY type represents a sequence of elements that share a single element type, in Databricks SQL and Databricks Runtime.
canonical_url: https://docs.databricks.com/aws/en/sql/language-manual/data-types/array-type
---

# `ARRAY` type

**Applies to:** ![check marked yes](https://docs.databricks.com/aws/en/images/icons/check.png) Databricks SQL ![check marked yes](https://docs.databricks.com/aws/en/images/icons/check.png) Databricks Runtime

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](https://docs.databricks.com/aws/en/sql/language-manual/functions/array.md) for details on how to produce literal array values.

See [\[ \] operator](https://docs.databricks.com/aws/en/sql/language-manual/functions/bracketsign.md) for details how to retrieve elements from an array.

## Examples

```sql
> 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]]

> SELECT a[1] FROM VALUES(ARRAY(3, 4)) AS T(a);
  4
```

## Related

* [\[\]](https://docs.databricks.com/aws/en/sql/language-manual/functions/bracketsign.md)
* [`MAP` type](https://docs.databricks.com/aws/en/sql/language-manual/data-types/map-type.md)
* [`STRUCT` type](https://docs.databricks.com/aws/en/sql/language-manual/data-types/struct-type.md)
* [`array` function](https://docs.databricks.com/aws/en/sql/language-manual/functions/array.md)
* [`cast` function](https://docs.databricks.com/aws/en/sql/language-manual/functions/cast.md)
