Constructs a MAP<K, V> of a specific type using several groups of key-value pairs
MAP( <key1> , <value1> [, <key2>, <value2> ... ])
<key1> supports multiple types (refer to MAP<K, V>) to construct the key of the map<value1> to construct the value of the mapSupports multiple groups of key-value parameters
Returns a specific type MAP<K, V> constructed from several groups of key-value pairs
Regular parameters
select map(1, "100", 0.1, 2),map(1, "100", 0.1, 2)[1];
+-----------------------+--------------------------+ | map(1, "100", 0.1, 2) | map(1, "100", 0.1, 2)[1] | +-----------------------+--------------------------+ | {1.0:"100", 0.1:"2"} | 100 | +-----------------------+--------------------------+
No parameters case
select map();
+-------+ | map() | +-------+ | {} | +-------+
NULL parameters
select map(null, 2, 3, null);
+-----------------------+ | map(null, 2, 3, null) | +-----------------------+ | {null:2, 3:null} | +-----------------------+
If there are duplicate keys, they will be deduplicated
select map(1, 2, 2, 11, 1, 3, null, "null 1", null, "null 2");
+--------------------------------------------------------+ | map(1, 2, 2, 11, 1, 3, null, "null 1", null, "null 2") | +--------------------------------------------------------+ | {2:"11", 1:"3", null:"null 2"} | +--------------------------------------------------------+