cardinality()

Returns the size of the map (or the number of entries in the map)

Arguments & returns

cardinality(map, …)

Scalar
Overload link map … Varargs Returns
#01 ANY ANY UBIGINT

… accepts a variable number of arguments of the type shown.

Example

cardinality example
SQL
Haybarn WASM 1.5.5-rc3 · In your browser

Engine example · Run to view results.

In other engines

Snowflakemap_size()

SELECT id, MAP_SIZE(attrs) AS attr_count FROM demo_maps
In Haybarn
SELECT id, CARDINALITY(attrs) AS attr_count FROM demo_maps

SQLGlot example ↗