Sorted Aggregate Functions
Aggregate functions compute a single result from a group of rows. These aggregate functions support the DISTINCT keyword, which filters out repeated values, and the standard ORDER BY syntax, which dictates the ordering of the aggregation. To sort the elements of an array, use the ARRAY_SORT function during data load.
Syntax
Substitute AGGREGATE with the function name. The ORDER BY syntax clause must be after all arguments to the aggregate function.

