CARDINALITY
Counts how many elements an array has.
Syntax
CARDINALITY(<array>)
Returns the total number of elements in an array, however many dimensions it has. For an empty array — 0. The similar ARRAY_LENGTH asks about the length of a specific dimension and gives NULL for an empty array. Handy for finding out how many tags or roles a row has, or for picking rows with a non-empty list.