pub fn build_with_existing_null_bitmap_and_slice<T>(
    null_bit_buffer: Option<Buffer>,
    null_count: usize,
    values: &[T::Native],
) -> PrimitiveArray<T>
where
    T: ArrowPrimitiveType,
{
    let len = values.len();
    // See:
    // https://docs.rs/arrow/0.16.0/src/arrow/array/builder.rs.html#314
    // TODO: make implementation for aligned owned vector for zero copy creation.
    let builder = ArrayData::builder(T::get_data_type())
        .len(len)
        .add_buffer(Buffer::from(values.to_byte_slice()));

    let builder = set_null_bits(builder, null_bit_buffer, Some(null_count), len);
    let data = builder.build();
    PrimitiveArray::<T>::from(data)
}
/// Take an existing slice and a null bitmap and construct an arrow array.
Take an existing slice and a null bitmap and construct an arrow array.
Take an existing slice and a null bitmap and construct an arrow array .
pub fn build_with_existing_null_bitmap_and_slice<T>(
    null_bit_buffer: Option<Buffer>,
    null_count: usize,
    values: &[T::Native],
) -> PrimitiveArray<T>
where
    T: ArrowPrimitiveType,
{
    let len = values.len();
    // See:
    // https://docs.rs/arrow/0.16.0/src/arrow/array/builder.rs.html#314
    // TODO: make implementation for aligned owned vector for zero copy creation.
    let builder = ArrayData::builder(T::get_data_type())
        .len(len)
        .add_buffer(Buffer::from(values.to_byte_slice()));
    let builder = set_null_bits(builder, null_bit_buffer, Some(null_count), len);
    let data = builder.build();
    PrimitiveArray::<T>::from(data)
}
pub fn build_with_existing_null_bitmap_and_slice < T > ( null_bit_buffer : Option < Buffer > , null_count : usize , values : & [ T :: Native ] , ) -> PrimitiveArray < T > where T : ArrowPrimitiveType , { let len = values . len ( ) ; // See: // https://docs.rs/arrow/0.16.0/src/arrow/array/builder.rs.html#314 // TODO: make implementation for aligned owned vector for zero copy creation. let builder = ArrayData :: builder ( T :: get_data_type ( ) ) . len ( len ) . add_buffer ( Buffer :: from ( values . to_byte_slice ( ) ) ) ; let builder = set_null_bits ( builder , null_bit_buffer , Some ( null_count ) , len ) ; let data = builder . build ( ) ; PrimitiveArray :: < T > :: from ( data ) }
Take an existing slice and a null bitmap and construct an arrow array.
Take an existing slice and a null bitmap and construct an arrow array .
null_bit_buffer
Option<Buffer>
null_count
usize
values
&[T::Native]
null_bit_buffer
Option<Buffer>
null_count
usize
values
&[T::Native]