map_from_entries
function
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. There must be no duplicates or nulls in the first field (the key).
Examples
> SELECT map_from_entries(array(struct(1, 'a'), struct(2, 'b')));
{1 -> a, 2 -> b}
Related functions
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for