fn take_values_validity<T: NativeType, I: Index>(
    values: &PrimitiveArray<T>,
    indices: &[I],
) -> (Buffer<T>, Option<Bitmap>) {
    let mut null = MutableBitmap::with_capacity(indices.len());

    let null_values = values.validity().unwrap();

    let values_values = values.values();

    let values = indices.iter().map(|index| {
        let index = index.to_usize();
        if null_values.get_bit(index) {
            null.push(true);
        } else {
            null.push(false);
        }
        values_values[index]
    });
    let buffer = MutableBuffer::from_trusted_len_iter(values);

    (buffer.into(), null.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 mut null = MutableBitmap::with_capacity(indices.len());
    let null_values = values.validity().unwrap();
    let values_values = values.values();
    let values = indices.iter().map(|index| {
        let index = index.to_usize();
        if null_values.get_bit(index) {
            null.push(true);
        } else {
            null.push(false);
        }
        values_values[index]
    });
    let buffer = MutableBuffer::from_trusted_len_iter(values);
    (buffer.into(), null.into())
}
fn take_values_validity < T : NativeType , I : Index > ( values : & PrimitiveArray < T > , indices : & [ I ] , ) -> ( Buffer < T > , Option < Bitmap > ) { let mut null = MutableBitmap :: with_capacity ( indices . len ( ) ) ; let null_values = values . validity ( ) . unwrap ( ) ; let values_values = values . values ( ) ; let values = indices . iter ( ) . map ( | index | { let index = index . to_usize ( ) ; if null_values . get_bit ( index ) { null . push ( true ) ; } else { null . push ( false ) ; } values_values [ index ] } ) ; let buffer = MutableBuffer :: from_trusted_len_iter ( values ) ; ( buffer . into ( ) , null . 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]