ARRAYS_TO_OBJECT

functionsupportedCore SQL functions

docs.snowflake.com ↗

Semi-structured and structured data functions

Returns an OBJECT that contains the keys specified by one input ARRAY and the values specified by another input ARRAY.

Syntax

ARRAYS_TO_OBJECT( <key_array> , <value_array> )

Parameters

NameRequiredDescription
key_arrayrequiredARRAY of VARCHAR values that specify the keys for the new OBJECT.
value_arrayrequiredARRAY of values for the new OBJECT. This ARRAY must be the same length as key_array. The values in this ARRAY should correspond to the keys in key_array.

Returns

The function returns a value of the type OBJECT. The OBJECT contains the keys and values specified by the input ARRAYs.

Usage notes