नोट
इस पेज तक पहुँच के लिए प्रमाणन की आवश्यकता होती है. आप साइन इन करने या निर्देशिकाओं को बदलने का प्रयास कर सकते हैं.
इस पेज तक पहुँच के लिए प्रमाणन की आवश्यकता होती है. आप निर्देशिकाओं को बदलने का प्रयास कर सकते हैं.
Applies to:
Databricks SQL
Databricks Runtime
Creates a map with a pair of the keys and values arrays.
Syntax
map_from_arrays(keys, values)
Arguments
keys: An ARRAY expression without duplicates or NULL.values: An ARRAY expression of the same cardinality askeys
Returns
A MAP where keys are of the element type of keys and values are of the element type of values.
Azure Databricks raises DUPLICATED_MAP_KEY if keys contains duplicates.
Common error conditions
Examples
> SELECT map_from_arrays(array(1.0, 3.0), array('2', '4'));
{1.0 -> 2, 3.0 -> 4}
> SELECT map_from_arrays(array(1, 1), array('a', 'b'));
Error: DUPLICATED_MAP_KEY