Menu
Amazon Athena
User Guide

Finding Lengths

The cardinality function returns the length of an array, as in this example:

SELECT cardinality(ARRAY[1,2,3,4]) AS item_count

This query returns:

+------------+ | item_count | +------------+ | 4 | +------------+