/// Take kernel for a single chunk without nulls and an iterator that can produce None values.
/// This is used in join operations.
///
/// # Safety
/// - no bounds checks
/// - iterator must be TrustedLen
Take kernel for a single chunk without nulls and an iterator that can produce None values.
This is used in join operations.
Take kernel for a single chunk without nulls and an iterator that can produce None values . This is used in join operations .
pub(crate) unsafe fn take_no_null_primitive_opt_iter_unchecked<
    T: PolarsPrimitiveType,
    I: IntoIterator<Item = Option<usize>>,
>(
    arr: &PrimitiveArray<T::Native>,
    indices: I,
) -> Arc<PrimitiveArray<T::Native>> {
    let array_values = arr.values().as_slice();
    let iter = indices
        .into_iter()
        .map(|opt_idx| opt_idx.map(|idx| *array_values.get_unchecked(idx)));
    let arr = PrimitiveArray::from_trusted_len_iter_unchecked(iter).to(T::get_dtype().to_arrow());
    Arc::new(arr)
}
pub ( crate ) unsafe fn take_no_null_primitive_opt_iter_unchecked < T : PolarsPrimitiveType , I : IntoIterator < Item = Option < usize > > , > ( arr : & PrimitiveArray < T :: Native > , indices : I , ) -> Arc < PrimitiveArray < T :: Native > > { let array_values = arr . values ( ) . as_slice ( ) ; let iter = indices . into_iter ( ) . map ( | opt_idx | opt_idx . map ( | idx | * array_values . get_unchecked ( idx ) ) ) ; let arr = PrimitiveArray :: from_trusted_len_iter_unchecked ( iter ) . to ( T :: get_dtype ( ) . to_arrow ( ) ) ; Arc :: new ( arr ) }
Take kernel for a single chunk without nulls and an iterator that can produce None values.
Take kernel for a single chunk without nulls and an iterator that can produce None values .
arr
&PrimitiveArray<T::Native>
indices
I
safety
no bounds checks
iterator must be TrustedLen
no bounds checks iterator must be TrustedLen