map_contains_key
function
Applies to: Databricks SQL Databricks Runtime 10.4 LTS and above
Returns true if map
contains key
.
Syntax
map_contains_key(map, key)
Arguments
map
: An map to be searched.key
: An expression with a type sharing a least common type with themap
keys.
Returns
A BOOLEAN.
If map
or key
is NULL
, the result is NULL
.
Examples
> SELECT map_contains_key(map(1, 'a', 2, 'b'), 2);
true
> SELECT map_contains_key(map(1, 'a', 2, 'b'), 3);
false
> SELECT map_contains_key(map(1, 'a', 2, 'b'), NULL);
NULL
Related
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