MAP_CONSTRUCT

functionsupportedCore SQL functions

docs.snowflake.com ↗

Semi-structured and structured data functions

Returns a MAP constructed from a series of alternating keys and values.

Syntax

supportedpartialnot supportednot scored

MAP_CONSTRUCT( <key_1>, <value_1> [ , <key_2>, <value_2> , ... ] )

Parameters

NameRequiredDescription
key_NrequiredThe key in a key-value pair. A key must be a VARCHAR or numeric value. All of the keys are cast to a single, common key type.
value_NrequiredThe value that is associated with the key. All of the values are cast to a single, common value type.

Returns

Returns a MAP whose key type is the common type of the keys (VARCHAR or a numeric type) and whose value type is the common type of the values. For example, MAP_CONSTRUCT('a', 1, 'b', 2) returns a MAP(VARCHAR, NUMBER) value.

Usage notes

See also