Lưu ý
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử đăng nhập hoặc thay đổi thư mục.
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử thay đổi thư mục.
Applies to:
Databricks SQL
Databricks Runtime
Creates a map with the specified key-value pairs.
Syntax
map( [key1, value1] [, ...] )
Arguments
keyN: An expression of any comparable type. AllkeyNmust share a least common type.valueN: An expression of any type. AllvalueNmust share a least common type.
Returns
A MAP with keys typed as the least common type of keyN and values typed as the least common type of valueN.
There can be 0 or more pairs.
Azure Databricks raises DUPLICATED_MAP_KEY if any keyN values are duplicates.
Azure Databricks raises NULL_MAP_KEY if any keyN is NULL.
Common error conditions
Examples
> SELECT map(1.0, '2', 3.0, '4');
{1.0 -> 2, 3.0 -> 4}
> SELECT map(1, 'a', 1, 'b');
Error: DUPLICATED_MAP_KEY