Get started
Load & manage data
Work with data
Administration
Reference & resources
CLUSTER BY
mask
ROW FILTER
Updated Dec 02, 2024
Send us feedback
cardinality
Applies to: Databricks SQL Databricks Runtime
Returns the size of expr.
expr
cardinality(expr)
expr: An ARRAY or MAP expression.
An INTEGER.
> SELECT cardinality(array('b', 'd', 'c', 'a')); 4 > SELECT cardinality(map('a', 1, 'b', 2)); 2