This section describes the following array functions
ARRAY_SUM: This function calculates the sum of all non-null elements of the input. If there are no non-null elements, returns 0. The behavior is similar to aggregate function SUM, but operates on an array.
COUNT_VALUES_IF: Returns the amount of
truevalues in a given array. This can be used with conditional operators to count the number of array elements that fulfil a condition. For example,
COUNT_VALUES_IF(my_values > 3)will return the number of elements that are greater than 3.
ELEMENT_AT: This function returns an element of an array at a given index. If index >= 0, this function provides the same functionality as the SQL-standard subscript operator (). If index < 0,
ELEMENT_ATaccesses elements from the last to the first.