pub fn sum<T>(array: &PrimitiveArray<T>) -> Option<T>
where
    T: NativeType + Simd,
    T::Simd: Add<Output = T::Simd> + Sum<T>,
{
    let null_count = array.null_count();

    if null_count == array.len() {
        return None;
    }

    match array.validity() {
        None => Some(nonnull_sum(array.values())),
        Some(bitmap) => Some(null_sum(array.values(), bitmap)),
    }
}
/// Returns the sum of values in the array.
///
/// Returns `None` if the array is empty or only contains null values.
Returns the sum of values in the array.
Returns `None` if the array is empty or only contains null values.
Returns the sum of values in the array . Returns ` None ` if the array is empty or only contains null values .
pub fn sum<T>(array: &PrimitiveArray<T>) -> Option<T>
where
    T: NativeType + Simd,
    T::Simd: Add<Output = T::Simd> + Sum<T>,
{
    let null_count = array.null_count();
    if null_count == array.len() {
        return None;
    }
    match array.validity() {
        None => Some(nonnull_sum(array.values())),
        Some(bitmap) => Some(null_sum(array.values(), bitmap)),
    }
}
pub fn sum < T > ( array : & PrimitiveArray < T > ) -> Option < T > where T : NativeType + Simd , T :: Simd : Add < Output = T :: Simd > + Sum < T > , { let null_count = array . null_count ( ) ; if null_count == array . len ( ) { return None ; } match array . validity ( ) { None => Some ( nonnull_sum ( array . values ( ) ) ) , Some ( bitmap ) => Some ( null_sum ( array . values ( ) , bitmap ) ) , } }
Returns the sum of values in the array.
Returns the sum of values in the array .
array
&PrimitiveArray<T>