Getting started
User guides
Administration guides
Reference guides
Resources
Updated Aug 11, 2022
Send us feedback
map_contains_key
Returns true if map contains key.
map
key
Since: Databricks Runtime 10.3
map_contains_key(map, key)
map: An map to be searched.
key: An expression with a type sharing a least common type with the map keys.
A BOOLEAN. If map or key is NULL, the result is NULL.
NULL
> 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
array_contains function
map function
map_keys function
map_values function
SQL data type rules