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.
ARRAY_SUM(array)
Name | Type | Description | Default Value |
---|---|---|---|
array | numeric | A numeric array | |
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.
array | Output |
---|---|
array[1, 0.2, 30] | 31.2 |
CREATE JOB function_operator_example
ADD_MISSING_COLUMNS = true
AS INSERT INTO default_glue_catalog.upsolver_samples.orders_transformed_data MAP_COLUMNS_BY_NAME
SELECT array[],
ARRAY_SUM(array[]) AS Output
FROM default_glue_catalog.upsolver_samples.orders_raw_data
LET array = array[1, 0.2, 30]
WHERE time_filter()
LIMIT 1;
array[] | Output |
---|---|
array[1, 0.2, 30] | 31.2 |
Last modified 27d ago