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 created from the specified array of entries.
Syntax
map_from_entries(expr)
Arguments
expr: An ARRAY expression of STRUCT with two fields.
Returns
A MAP where keys are the first field of the structs and values the second.
Azure Databricks raises DUPLICATED_MAP_KEY if there are duplicate keys.
Common error conditions
Examples
> SELECT map_from_entries(array(struct(1, 'a'), struct(2, 'b')));
{1 -> a, 2 -> b}
> SELECT map_from_entries(array(struct(1, 'a'), struct(1, 'b')));
Error: DUPLICATED_MAP_KEY