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.
Syntax
Arguments
Name | Type | Description | Default Value |
---|---|---|---|
array | numeric | A numeric array |
Returns
the sum of all non-null elements of the input. if there are no non-null elements, returns 0. a primitive value input is considered to be an array with a single element.
Examples
array | Output |
---|---|
array[1, 0.2, 30] | 31.2 |
Transformation job example
SQL
Query result
array[] | Output |
---|---|
array[1, 0.2, 30] | 31.2 |
Last updated