pub(crate) unsafe fn take_bool_opt_iter_unchecked<I: IntoIterator<Item = Option<usize>>>(
    arr: &BooleanArray,
    indices: I,
) -> Arc<BooleanArray> {
    let validity = arr.validity().as_ref().expect("should have nulls");
    let iter = indices.into_iter().map(|opt_idx| {
        opt_idx.and_then(|idx| {
            if validity.get_bit_unchecked(idx) {
                Some(arr.value_unchecked(idx))
            } else {
                None
            }
        })
    });

    Arc::new(BooleanArray::from_trusted_len_iter_unchecked(iter))
}
/// Take kernel for single chunk and an iterator as index.
/// # Safety
/// - no bounds checks
/// - iterator must be TrustedLen
Take kernel for single chunk and an iterator as index.
Take kernel for single chunk and an iterator as index .
pub(crate) unsafe fn take_bool_opt_iter_unchecked<I: IntoIterator<Item = Option<usize>>>(
    arr: &BooleanArray,
    indices: I,
) -> Arc<BooleanArray> {
    let validity = arr.validity().as_ref().expect("should have nulls");
    let iter = indices.into_iter().map(|opt_idx| {
        opt_idx.and_then(|idx| {
            if validity.get_bit_unchecked(idx) {
                Some(arr.value_unchecked(idx))
            } else {
                None
            }
        })
    });
    Arc::new(BooleanArray::from_trusted_len_iter_unchecked(iter))
}
pub ( crate ) unsafe fn take_bool_opt_iter_unchecked < I : IntoIterator < Item = Option < usize > > > ( arr : & BooleanArray , indices : I , ) -> Arc < BooleanArray > { let validity = arr . validity ( ) . as_ref ( ) . expect ( " " ) ; let iter = indices . into_iter ( ) . map ( | opt_idx | { opt_idx . and_then ( | idx | { if validity . get_bit_unchecked ( idx ) { Some ( arr . value_unchecked ( idx ) ) } else { None } } ) } ) ; Arc :: new ( BooleanArray :: from_trusted_len_iter_unchecked ( iter ) ) }
Take kernel for single chunk and an iterator as index.
Take kernel for single chunk and an iterator as index .
arr
&BooleanArray
indices
I
arr
&BooleanArray
indices
I
safety
no bounds checks
iterator must be TrustedLen
no bounds checks iterator must be TrustedLen