cardinality
function
Applies to: Databricks SQL Databricks Runtime
Returns the size of expr
.
Syntax
cardinality(expr)
Arguments
expr
: An ARRAY or MAP expression.
Returns
An INTEGER.
Examples
> SELECT cardinality(array('b', 'd', 'c', 'a'));
4
> SELECT cardinality(map('a', 1, 'b', 2));
2
Related functions
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for