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 |
+----------+