Function arrow::compute::sum

source ·
pub fn sum<T>(
    array: &PrimitiveArray<T>
) -> Option<<T as ArrowPrimitiveType>::Native>where
    T: ArrowNumericType,
    <T as ArrowPrimitiveType>::Native: ArrowNativeTypeOp,
Expand description

Returns the sum of values in the primitive array.

Returns None if the array is empty or only contains null values.

This doesn’t detect overflow. Once overflowing, the result will wrap around. For an overflow-checking variant, use sum_checked instead.