MAP_SIZE
Descriptionβ
Count the number of elements in a Map
Syntaxβ
MAP_SIZE(<map>)
Parametersβ
Parameter | Description |
---|---|
<map> | Input map content |
Return Valueβ
Returns the number of elements in the Map
Exampleβ
select map_size(map()),map_size(map(1, "100", 0.1, 2));
+-----------------+-------------------------------------------------------------------------------------------------+
| map_size(map()) | map_size(map(cast(1 as DECIMALV3(2, 1)), '100', cast(0.1 as DECIMALV3(2, 1)), cast(2 as TEXT))) |
+-----------------+-------------------------------------------------------------------------------------------------+
| 0 | 2 |
+-----------------+-------------------------------------------------------------------------------------------------+