/// Take kernel for single chunk without nulls and an iterator as index.
///
/// # Safety
/// - no bounds checks
/// - iterator must be TrustedLen
Take kernel for single chunk without nulls and an iterator as index.
Take kernel for single chunk without nulls and an iterator as index .
pub(crate) unsafe fn take_no_null_primitive_iter_unchecked<
    T: PolarsPrimitiveType,
    I: IntoIterator<Item = usize>,
>(
    arr: &PrimitiveArray<T::Native>,
    indices: I,
) -> Arc<PrimitiveArray<T::Native>> {
    assert_eq!(arr.null_count(), 0);
    let array_values = arr.values().as_slice();
    let iter = indices
        .into_iter()
        .map(|idx| *array_values.get_unchecked(idx));
    let values = Buffer::from_trusted_len_iter_unchecked(iter);
    Arc::new(PrimitiveArray::from_data(
        T::get_dtype().to_arrow(),
        values,
        None,
    ))
}
pub ( crate ) unsafe fn take_no_null_primitive_iter_unchecked < T : PolarsPrimitiveType , I : IntoIterator < Item = usize > , > ( arr : & PrimitiveArray < T :: Native > , indices : I , ) -> Arc < PrimitiveArray < T :: Native > > { assert_eq ! ( arr null_count ( ) 0 ) ; let array_values = arr . values ( ) . as_slice ( ) ; let iter = indices . into_iter ( ) . map ( | idx | * array_values . get_unchecked ( idx ) ) ; let values = Buffer :: from_trusted_len_iter_unchecked ( iter ) ; Arc :: new ( PrimitiveArray :: from_data ( T :: get_dtype ( ) . to_arrow ( ) , values , None , ) ) }
Take kernel for single chunk without nulls and an iterator as index.
Take kernel for single chunk without nulls and an iterator as index .
arr
&PrimitiveArray<T::Native>
indices
I
safety
no bounds checks
iterator must be TrustedLen
no bounds checks iterator must be TrustedLen