---
cuppy_hub: salesforce
cuppy_path: reference/official/data360/data-cloud-query-guide/references/dc-sql-reference/array.md
cuppy_section: docs
cuppy_doc: 7ZVC-SCZP
cuppy_doc_uuid: 886b73bb-0898-480f-8689-6c056ff88819
cuppy_permalink: https://cuppy.io/salesforce/d/7ZVC-SCZP
cuppy_version: 1
cuppy_updated: 2026-10-23T16:16:52.575Z
cuppy_canonical: https://cuppy.io/salesforce/docs/reference/official/data360/data-cloud-query-guide/references/dc-sql-reference/array
cuppy_mcp: https://cuppy.io/mcp
cuppy_body_sha256: 7f97ce215c9d1f2737b4e639390239d7ead9c68c496217ac024df3d7b60b79fe
# cuppy_body_sha256 is over the document body ALONE, excluding both generated blocks.
---

> Mirror of <https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/array.html> (Salesforce, Data 360 Query Guide), read 2026-10-23. Salesforce's own page is the authority; this copy exists because that site refuses non-browser readers.

## Array Type

**Applies to:** ✅ Data 360 SQL ✅ Tableau Hyper API

An array is a sequential collection of elements in a single SQL value. Arrays can model dependent information with an inherent ordering in a single row. For example, time series data from longitudinal studies or embedding vectors from machine learning models.

Array type syntax:

The optional `not null` specifier indicates if array elements can be `null`. For example, `array(integer not null)` represents a range of non-null integer elements.

All array types have these properties.

*   Arrays have variable length. Within a column, arrays aren’t required to have the same number of elements.
*   Arrays are one-dimensional.

For a comprehensive overview of supported operations on arrays, see [Array Functions](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/arrays.html).

You can create arrays in two ways.

*   By using the [Array Constructor](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/array-constructor.html) syntax.

*   By casting a string literal to an array with `::array(<type>)`.

An array string literal consists of a comma-separated list of element literals surrounded by square brackets `[...]`. The element literal syntax is identical to that of the respective atomic type.

For string array types, any upper or lower case variant of the element literal `null` is parsed as a `null` value. To specify the string `"null"`, escape the element literal by using double quotes. For example:

Returns: `[NULL,"null"]` — a null element, followed by the string `'null'`.

When returning an array of text types, every non-null element is quoted.

See [Type Conversions](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/type-conversion.html) for `CAST`, `TRY_CAST`, and `::`.

Arrays are strongly typed and use the array’s element type for all elements in the array. The element type is a defining part of the array’s overall type, meaning that `array(integer)` is a different type than `array(boolean)` or `array(text)`. You can build an array from any [atomic type](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/datatypes.html#atomic-types) supported by Data 360 SQL.

Part of an array’s element type is the element’s nullability. For example, `array(smallint)` is different from `array(smallint not null)`.

These four options represent different array types.

| Type | Array nullable? | Elements nullable? | Possible values |
| --- | --- | --- | --- |
| `array(integer)` | yes | yes | `[]`,`[1,2,3]`,`[1,2,null]`, `null` |
| `array(integer not null)` | yes | no | `[]`,`[1,2,3]`,`null` |
| `array(integer) not null` | no | yes | `[]`,`[1,2,3]`,`[1,2,null]` |
| `array(integer not null) not null` | no | no | `[]`,`[1,2,3]` |

The inner nullability of an array type can be changed by casting, using the conventional [cast syntax](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/type-conversion.html).

Nullable to non-nullable:

Non-nullable to nullable:

A cast from a non-nullable element type to its nullable counterpart always succeeds. The reverse direction succeeds if the array doesn’t contain `null` elements. Casts across element types aren’t supported. The only exception is casts from array to string types.

Non-nullable element types use less memory and turn on optimizations for certain array operations. Use the most “restrictive” element type possible based on the use case at hand.

Arrays have these limitations.

*   The size of an array is limited to 4GB.
*   Arrays can’t be nested.
*   Arrays can’t be used as column types in non-temporary tables.

See the restrictions regarding array support in [external formats](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/external-formats.html).


---
<!-- cuppy -->
You are reading one file. The same content is free over MCP at https://cuppy.io/mcp with no signup: ranked search across all 376 documents in this hub, the merged view when you work in a layer, known workarounds matched to the error you hit, and depth control so you spend tokens on what you need. Start with the `_hello` tool. How to connect: https://cuppy.io/salesforce/ Something wrong in this document? Report it with the `session feedback` tool on the same endpoint.
<!-- /cuppy -->
