> ## 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.

# MAP_VALUES

> Returns the values of a map as an array.

<div className="e6-meta"><span className="e6-eyebrow e6-eyebrow--quiet">Scalar function</span></div>

Returns NULL for a NULL map. NULL map values are retained.

## Syntax

### Scalar

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
map_values(map)
```

## Arguments

Type notation used below:

* V is the map value type: BOOLEAN, TINYINT, SMALLINT, INTEGER, BIGINT, FLOAT, DOUBLE, DECIMAL(p, s), STRING, BINARY, DATE, TIME, TIMESTAMP, ARRAY, MAP or STRUCT.

| Name | Type | Required | Description |
| - | - | - | - |
| map | MAP\<K,V> | Yes | The map to inspect. K is the map key type: BOOLEAN, TINYINT, SMALLINT, INTEGER, BIGINT, FLOAT, DOUBLE, DECIMAL(p, s), STRING, BINARY, DATE, TIME, TIMESTAMP, ARRAY, MAP or STRUCT. A lookup key must have the map's key type after conversion. Map keys must be non-NULL. Nested values retain their declared element/field types. |

## Returns

* Type: ARRAY\<V>
* Possible values: One value per map entry.
* NULL behavior: Returns NULL for a NULL map. NULL map values are retained.
* Shape: Array length equals map entry count.
* Ordering: Underlying map entry order; no key sorting is performed.

## Properties

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

## Usage notes

* 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.
* For ARRAY-valued keys or values, construct the input map with MAP\_FROM\_ARRAYS. The ordinary two-argument MAP constructor can interpret ARRAY arguments as parallel key/value lists.

## Examples

### Typical behavior

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT map_values(map_from_arrays(ARRAY['a', 'b'], ARRAY[1, NULL])) AS "value";
```

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

### String map values

Map entry order is not a general sorting guarantee.

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT map_values(map(10, 'red', 20, 'blue')) AS colors;
```

| colors |
| - |
| \["red","blue"] |


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