Function map_cat

Source
fn map_cat(
    m1: Option<MapRef<'_>>,
    m2: Option<MapRef<'_>>,
) -> Result<Option<MapValue>, ExprError>
Expand description

If both m1 and m2 have a value with the same key, then the output map contains the value from m2.

query T
select map_cat(MAP{'a':1,'b':2},null::map(varchar,int));
----
{a:1,b:2}

query T
select map_cat(MAP{'a':1,'b':2},MAP{'b':3,'c':4});
----
{a:1,b:3,c:4}

# implicit type cast
query T
select map_cat(MAP{'a':1,'b':2},MAP{'b':3.0,'c':4.0});
----
{a:1,b:3.0,c:4.0}