pub(crate) unsafe fn take_no_null_primitive<T: PolarsNumericType>(
    arr: &PrimitiveArray<T>,
    indices: &UInt32Array,
) -> Arc<PrimitiveArray<T>> {
    assert_eq!(arr.null_count(), 0);

    let data_len = indices.len();
    let array_values = arr.values();
    let index_values = indices.values();

    let mut values = AlignedVec::<T::Native>::with_capacity_aligned(data_len);
    let iter = index_values
        .iter()
        .map(|idx| *array_values.get_unchecked(*idx as usize));
    values.extend(iter);

    let nulls = indices.data_ref().null_buffer().cloned();

    let arr = aligned_vec_to_primitive_array(values, nulls, Some(indices.null_count()));
    Arc::new(arr)
}
/// Forked snippet from Arrow. Only does not write to a Vec, but directly to aligned memory.
Forked snippet from Arrow. Only does not write to a Vec, but directly to aligned memory.
Forked snippet from Arrow . Only does not write to a Vec but directly to aligned memory .
pub(crate) unsafe fn take_no_null_primitive<T: PolarsNumericType>(
    arr: &PrimitiveArray<T>,
    indices: &UInt32Array,
) -> Arc<PrimitiveArray<T>> {
    assert_eq!(arr.null_count(), 0);
    let data_len = indices.len();
    let array_values = arr.values();
    let index_values = indices.values();
    let mut values = AlignedVec::<T::Native>::with_capacity_aligned(data_len);
    let iter = index_values
        .iter()
        .map(|idx| *array_values.get_unchecked(*idx as usize));
    values.extend(iter);
    let nulls = indices.data_ref().null_buffer().cloned();
    let arr = aligned_vec_to_primitive_array(values, nulls, Some(indices.null_count()));
    Arc::new(arr)
}
pub ( crate ) unsafe fn take_no_null_primitive < T : PolarsNumericType > ( arr : & PrimitiveArray < T > , indices : & UInt32Array , ) -> Arc < PrimitiveArray < T > > { assert_eq ! ( arr null_count ( ) 0 ) ; let data_len = indices . len ( ) ; let array_values = arr . values ( ) ; let index_values = indices . values ( ) ; let mut values = AlignedVec :: < T :: Native > :: with_capacity_aligned ( data_len ) ; let iter = index_values . iter ( ) . map ( | idx | * array_values . get_unchecked ( * idx as usize ) ) ; values . extend ( iter ) ; let nulls = indices . data_ref ( ) . null_buffer ( ) . cloned ( ) ; let arr = aligned_vec_to_primitive_array ( values , nulls , Some ( indices . null_count ( ) ) ) ; Arc :: new ( arr ) }
Forked snippet from Arrow.
Forked snippet from Arrow .
arr
&PrimitiveArray<T>
indices
&UInt32Array
arr
&PrimitiveArray<T>
indices
&UInt32Array