// take implementation when only values contain nulls
take implementation when only values contain nulls
take implementation when only values contain nulls
fn take_values_validity<I: Index>(
    values: &BooleanArray,
    indices: &[I],
) -> (Bitmap, Option<Bitmap>) {
    let mut validity = MutableBitmap::with_capacity(indices.len());
    let validity_values = values.validity().unwrap();
    let values_values = values.values();
    let values = indices.iter().map(|index| {
        let index = index.to_usize();
        if validity_values.get_bit(index) {
            validity.push(true);
        } else {
            validity.push(false);
        }
        values_values.get_bit(index)
    });
    let buffer = Bitmap::from_trusted_len_iter(values);
    (buffer, validity.into())
}
fn take_values_validity < I : Index > ( values : & BooleanArray , indices : & [ I ] , ) -> ( Bitmap , Option < Bitmap > ) { let mut validity = MutableBitmap :: with_capacity ( indices . len ( ) ) ; let validity_values = values . validity ( ) . unwrap ( ) ; let values_values = values . values ( ) ; let values = indices . iter ( ) . map ( | index | { let index = index . to_usize ( ) ; if validity_values . get_bit ( index ) { validity . push ( true ) ; } else { validity . push ( false ) ; } values_values . get_bit ( index ) } ) ; let buffer = Bitmap :: from_trusted_len_iter ( values ) ; ( buffer , validity . into ( ) ) }
take implementation when only values contain nulls
take implementation when only values contain nulls
values
&BooleanArray
indices
&[I]