// take implementation when both values and indices contain nulls
take implementation when both values and indices contain nulls
take implementation when both values and indices contain nulls
fn take_values_indices_validity<I: Index>(
    values: &BooleanArray,
    indices: &PrimitiveArray<I>,
) -> (Bitmap, Option<Bitmap>) {
    let mut validity = MutableBitmap::with_capacity(indices.len());
    let values_validity = values.validity().unwrap();
    let values_values = values.values();
    let values = indices.iter().map(|index| match index {
        Some(index) => {
            let index = index.to_usize();
            validity.push(values_validity.get_bit(index));
            values_values.get_bit(index)
        }
        None => {
            validity.push(false);
            false
        }
    });
    let values = Bitmap::from_trusted_len_iter(values);
    (values, validity.into())
}
fn take_values_indices_validity < I : Index > ( values : & BooleanArray , indices : & PrimitiveArray < I > , ) -> ( Bitmap , Option < Bitmap > ) { let mut validity = MutableBitmap :: with_capacity ( indices . len ( ) ) ; let values_validity = values . validity ( ) . unwrap ( ) ; let values_values = values . values ( ) ; let values = indices . iter ( ) . map ( | index | match index { Some ( index ) => { let index = index . to_usize ( ) ; validity . push ( values_validity . get_bit ( index ) ) ; values_values . get_bit ( index ) } None => { validity . push ( false ) ; false } } ) ; let values = Bitmap :: from_trusted_len_iter ( values ) ; ( values , validity . into ( ) ) }
take implementation when both values and indices contain nulls
take implementation when both values and indices contain nulls
values
&BooleanArray
indices
&PrimitiveArray<I>