Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
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 themapkeys.
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