The new mechanism for dynamically building native functions introduced by
CASSANDRA-17811 can be used to provide within-collection aggregation functions. We can use that mechanism to add new CQL functions to get:
- The number of items in a collection.
- The max/min items of a collection.
- The sum/avg of the items of a numeric collection.
- The keys or the values of a map.
Note that this type of aggregation is different from the kind of aggregation provided by min, max, sum and avg, which aggregate entire collections across rows. Here we only aggregate the items of a collection row per row.