// 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<T: NativeType, I: Index>(
    values: &PrimitiveArray<T>,
    indices: &PrimitiveArray<I>,
) -> (Buffer<T>, Option<Bitmap>) {
    let mut bitmap = 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();
            bitmap.push(values_validity.get_bit(index));
            values_values[index]
        }
        None => {
            bitmap.push(false);
            T::default()
        }
    });
    let buffer = MutableBuffer::from_trusted_len_iter(values);
    (buffer.into(), bitmap.into())
}
fn take_values_indices_validity < T : NativeType , I : Index > ( values : & PrimitiveArray < T > , indices : & PrimitiveArray < I > , ) -> ( Buffer < T > , Option < Bitmap > ) { let mut bitmap = 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 ( ) ; bitmap . push ( values_validity . get_bit ( index ) ) ; values_values [ index ] } None => { bitmap . push ( false ) ; T :: default ( ) } } ) ; let buffer = MutableBuffer :: from_trusted_len_iter ( values ) ; ( buffer . into ( ) , bitmap . into ( ) ) }
take implementation when both values and indices contain nulls
take implementation when both values and indices contain nulls
values
&PrimitiveArray<T>
indices
&PrimitiveArray<I>