pub fn sum_primitive<T>(array: &PrimitiveArray<T>) -> Option<T>
where
    T: NativeType + Simd + Add<Output = T> + std::iter::Sum<T>,
    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_primitive<T>(array: &PrimitiveArray<T>) -> Option<T>
where
    T: NativeType + Simd + Add<Output = T> + std::iter::Sum<T>,
    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_primitive < T > ( array : & PrimitiveArray < T > ) -> Option < T > where T : NativeType + Simd + Add < Output = T > + std :: iter :: Sum < T > , 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>
array
&PrimitiveArray<T>