ARRAY_SUM

All functions > ARRAY > ARRAY_SUM

Returns the sum of all numeric elements in an array.

Syntax

ARRAY_SUM(array: ARRAY<T>) → T
sql

Type Parameters:

  • T: Numeric type (BIGINT, DOUBLE, etc.)

Arguments

ParameterTypeRequiredDescription
arrayARRAY<T>YesThe numeric array to sum

Returns

The sum of all numeric elements in the array

Notes

  • Adds all numeric values in the array
  • Ignores NULL values (treats them as 0)
  • Returns NULL for empty arrays
  • Handles negative values correctly
  • May overflow for very large sums
  • Only works with numeric arrays
Last update at: 2025/10/13 10:23:46