Skip to content
Rene Saarsoo edited this page Nov 10, 2023 · 3 revisions

Some SQL dialects have special syntax for creating and manipulating Array and Map types.

Literals

Array literals [1, "two", 3]. Supported by:

Array literals ARRAY[1, 2, 3]. Supported by:

Map literals in JSON style {"foo": 1, "bar": "John"}. Supported by:

Accessors

Array and Map access using square brackets like arr[1] and map['key'].

Supported by:

Array subscript operator arr[OFFSET(5)]. Supported by:

Notes:

  1. Snowflake also supports a dot syntax to access the values of keys. The first key has to be extracted with : after that, . can be used to access deeper nested values.
Clone this wiki locally