fn take_values_validity<T: NativeType, I: Index>(
    values: &PrimitiveArray<T>,
    indices: &[I],
) -> (Buffer<T>, Option<Bitmap>) {
    let values_validity = values.validity().unwrap();

    let validity = indices
        .iter()
        .map(|index| values_validity.get_bit(index.to_usize()));
    let validity = MutableBitmap::from_trusted_len_iter(validity);

    let values_values = values.values();

    let values = indices
        .iter()
        .map(|index| values_values[index.to_usize()])
        .collect::<Vec<_>>();

    (values.into(), validity.into())
}
// 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<T: NativeType, I: Index>(
    values: &PrimitiveArray<T>,
    indices: &[I],
) -> (Buffer<T>, Option<Bitmap>) {
    let values_validity = values.validity().unwrap();
    let validity = indices
        .iter()
        .map(|index| values_validity.get_bit(index.to_usize()));
    let validity = MutableBitmap::from_trusted_len_iter(validity);
    let values_values = values.values();
    let values = indices
        .iter()
        .map(|index| values_values[index.to_usize()])
        .collect::<Vec<_>>();
    (values.into(), validity.into())
}
fn take_values_validity < T : NativeType , I : Index > ( values : & PrimitiveArray < T > , indices : & [ I ] , ) -> ( Buffer < T > , Option < Bitmap > ) { let values_validity = values . validity ( ) . unwrap ( ) ; let validity = indices . iter ( ) . map ( | index | values_validity . get_bit ( index . to_usize ( ) ) ) ; let validity = MutableBitmap :: from_trusted_len_iter ( validity ) ; let values_values = values . values ( ) ; let values = indices . iter ( ) . map ( | index | values_values [ index . to_usize ( ) ] ) . collect :: < Vec < _ > > ( ) ; ( values . into ( ) , validity . into ( ) ) }
take implementation when only values contain nulls
take implementation when only values contain nulls
values
&PrimitiveArray<T>
indices
&[I]
values
&PrimitiveArray<T>
indices
&[I]