Categories:

Semi-structured and structured data functions (Map)

MAP_SIZE

Returns the size of a MAP.

Syntax

MAP_SIZE( <map> )
Copy

Arguments

map

The input map.

Returns

Returns the number of entries in the map.

Examples

Determine the number of entries in a map:

SELECT MAP_SIZE({'a':1,'b':2,'c':3}::MAP(VARCHAR,NUMBER))
  AS map_size;
Copy
+----------+
| MAP_SIZE |
|----------|
|        3 |
+----------+
Language: English