Function map_contains

Source
fn map_contains(
    map: MapRef<'_>,
    key: ScalarRefImpl<'_>,
) -> Result<bool, ExprError>
Expand description
query T
select
    map_contains(MAP{1:1}, 1),
    map_contains(MAP{1:1}, 2),
    map_contains(MAP{1:1}, NULL),
    map_contains(MAP{1:1}, '1'),
    map_contains(MAP{'a':'1','b':'2'}, 'ab');
----
t f NULL t f


query error
select map_contains(MAP{1:1}, 1.0);
----
db error: ERROR: Failed to run the query

Caused by these errors (recent errors listed first):
  1: Failed to bind expression: map_contains(MAP {1: 1}, 1.0)
  2: Bind error: Cannot check if numeric exists in map(integer,integer)


query error
select map_contains(MAP{1:1}, NULL::varchar);
----
db error: ERROR: Failed to run the query

Caused by these errors (recent errors listed first):
  1: Failed to bind expression: map_contains(MAP {1: 1}, CAST(NULL AS CHARACTER VARYING))
  2: Bind error: Cannot check if character varying exists in map(integer,integer)