pub fn from_data(data_type: DataType, values: Buffer<T>, validity: Option<Bitmap>) -> Self {
        if !data_type.to_physical_type().eq_primitive(T::PRIMITIVE) {
            Err(ArrowError::InvalidArgumentError(format!(
                "Type {} does not support logical type {:?}",
                std::any::type_name::<T>(),
                data_type
            )))
            .unwrap()
        }
        if let Some(ref validity) = validity {
            assert_eq!(values.len(), validity.len());
        }
        Self {
            data_type,
            values,
            validity,
        }
    }
/// The canonical method to create a [`PrimitiveArray`] out of low-end APIs.
/// # Panics
/// This function panics iff:
/// * `data_type` is not supported by the physical type
/// * The validity is not `None` and its length is different from the `values`'s length
The canonical method to create a [`PrimitiveArray`] out of low-end APIs.
The canonical method to create a [ ` PrimitiveArray ` ] out of low - end APIs .
pub fn from_data(data_type: DataType, values: Buffer<T>, validity: Option<Bitmap>) -> Self {
        if !data_type.to_physical_type().eq_primitive(T::PRIMITIVE) {
            Err(ArrowError::InvalidArgumentError(format!(
                "Type {} does not support logical type {:?}",
                std::any::type_name::<T>(),
                data_type
            )))
            .unwrap()
        }
        if let Some(ref validity) = validity {
            assert_eq!(values.len(), validity.len());
        }
        Self {
            data_type,
            values,
            validity,
        }
    }
pub fn from_data ( data_type : DataType , values : Buffer < T > , validity : Option < Bitmap > ) -> Self { if ! data_type . to_physical_type ( ) . eq_primitive ( T :: PRIMITIVE ) { Err ( ArrowError :: InvalidArgumentError ( format ! ( " " std any type_name T ( ) data_type ) ) ) . unwrap ( ) } if let Some ( ref validity ) = validity { assert_eq ! ( values len ( ) validity len ( ) ) ; } Self { data_type , values , validity , } }
The canonical method to create a [`PrimitiveArray`] out of low-end APIs.
The canonical method to create a [ ` PrimitiveArray ` ] out of low - end APIs .
data_type
DataType
values
Buffer<T>
validity
Option<Bitmap>
data_type
DataType
values
Buffer<T>
validity
Option<Bitmap>
panics
This function panics iff:
`data_type` is not supported by the physical type
The validity is not `None` and its length is different from the `values`'s length
This function panics iff : ` data_type ` is not supported by the physical type The validity is not ` None ` and its length is different from the ` values ` ' s length