- Categories:
MAP_DELETE¶
Returns a MAP based on an existing MAP with one or more keys removed.
Syntax¶
Arguments¶
mapThe map that contains the key to remove.
keyNThe key to be omitted from the returned map.
Returns¶
Returns a MAP that contains the contents of the input (source) map with one or more keys removed.
Usage notes¶
The type of the key expression must match the type of the map’s key. If the type is VARCHAR, then the types can be different lengths.
Key values that aren’t found in the map are ignored.
Examples¶
Remove two key-value pairs from a map containing three key-value pairs:
Create a temporary table that contains MAP values:
Query the table to show the data:
Remove the keys in the del_key1 and del_key2 columns from the MAP values in the attrs column: