pub fn take<T: NativeType, I: Index>(
    values: &PrimitiveArray<T>,
    indices: &PrimitiveArray<I>,
) -> PrimitiveArray<T> {
    let indices_has_validity = indices.null_count() > 0;
    let values_has_validity = values.null_count() > 0;
    let (buffer, validity) = match (values_has_validity, indices_has_validity) {
        (false, false) => take_no_validity::<T, I>(values.values(), indices.values()),
        (true, false) => take_values_validity::<T, I>(values, indices.values()),
        (false, true) => take_indices_validity::<T, I>(values.values(), indices),
        (true, true) => take_values_indices_validity::<T, I>(values, indices),
    };

    PrimitiveArray::<T>::from_data(values.data_type().clone(), buffer, validity)
}
/// `take` implementation for primitive arrays
`take` implementation for primitive arrays
` take ` implementation for primitive arrays
pub fn take<T: NativeType, I: Index>(
    values: &PrimitiveArray<T>,
    indices: &PrimitiveArray<I>,
) -> PrimitiveArray<T> {
    let indices_has_validity = indices.null_count() > 0;
    let values_has_validity = values.null_count() > 0;
    let (buffer, validity) = match (values_has_validity, indices_has_validity) {
        (false, false) => take_no_validity::<T, I>(values.values(), indices.values()),
        (true, false) => take_values_validity::<T, I>(values, indices.values()),
        (false, true) => take_indices_validity::<T, I>(values.values(), indices),
        (true, true) => take_values_indices_validity::<T, I>(values, indices),
    };
    PrimitiveArray::<T>::from_data(values.data_type().clone(), buffer, validity)
}
pub fn take < T : NativeType , I : Index > ( values : & PrimitiveArray < T > , indices : & PrimitiveArray < I > , ) -> PrimitiveArray < T > { let indices_has_validity = indices . null_count ( ) > 0 ; let values_has_validity = values . null_count ( ) > 0 ; let ( buffer , validity ) = match ( values_has_validity , indices_has_validity ) { ( false , false ) => take_no_validity :: < T , I > ( values . values ( ) , indices . values ( ) ) , ( true , false ) => take_values_validity :: < T , I > ( values , indices . values ( ) ) , ( false , true ) => take_indices_validity :: < T , I > ( values . values ( ) , indices ) , ( true , true ) => take_values_indices_validity :: < T , I > ( values , indices ) , } ; PrimitiveArray :: < T > :: from_data ( values . data_type ( ) . clone ( ) , buffer , validity ) }
`take` implementation for primitive arrays
` take ` implementation for primitive arrays
values
&PrimitiveArray<T>
indices
&PrimitiveArray<I>
values
&PrimitiveArray<T>
indices
&PrimitiveArray<I>