fn take_dict<T, I>(
    values: &DictionaryArray<T>,
    indices: &PrimitiveArray<I>,
) -> Result<DictionaryArray<T>>
where
    T: ArrowPrimitiveType,
    T::Native: num::Num,
    I: ArrowNumericType,
    I::Native: ToPrimitive,
{
    let new_keys = take_primitive::<T, I>(values.keys(), indices)?;
    let new_keys_data = new_keys.data_ref();

    let data = ArrayData::new(
        values.data_type().clone(),
        new_keys.len(),
        Some(new_keys_data.null_count()),
        new_keys_data.null_buffer().cloned(),
        0,
        new_keys_data.buffers().to_vec(),
        values.data().child_data().to_vec(),
    );

    Ok(DictionaryArray::<T>::from(data))
}
/// `take` implementation for dictionary arrays
///
/// applies `take` to the keys of the dictionary array and returns a new dictionary array
/// with the same dictionary values and reordered keys
`take` implementation for dictionary arrays
applies `take` to the keys of the dictionary array and returns a new dictionary array
with the same dictionary values and reordered keys
` take ` implementation for dictionary arrays applies ` take ` to the keys of the dictionary array and returns a new dictionary array with the same dictionary values and reordered keys
fn take_dict<T, I>(
    values: &DictionaryArray<T>,
    indices: &PrimitiveArray<I>,
) -> Result<DictionaryArray<T>>
where
    T: ArrowPrimitiveType,
    T::Native: num::Num,
    I: ArrowNumericType,
    I::Native: ToPrimitive,
{
    let new_keys = take_primitive::<T, I>(values.keys(), indices)?;
    let new_keys_data = new_keys.data_ref();
    let data = ArrayData::new(
        values.data_type().clone(),
        new_keys.len(),
        Some(new_keys_data.null_count()),
        new_keys_data.null_buffer().cloned(),
        0,
        new_keys_data.buffers().to_vec(),
        values.data().child_data().to_vec(),
    );
    Ok(DictionaryArray::<T>::from(data))
}
fn take_dict < T , I > ( values : & DictionaryArray < T > , indices : & PrimitiveArray < I > , ) -> Result < DictionaryArray < T > > where T : ArrowPrimitiveType , T :: Native : num :: Num , I : ArrowNumericType , I :: Native : ToPrimitive , { let new_keys = take_primitive :: < T , I > ( values . keys ( ) , indices ) ? ; let new_keys_data = new_keys . data_ref ( ) ; let data = ArrayData :: new ( values . data_type ( ) . clone ( ) , new_keys . len ( ) , Some ( new_keys_data . null_count ( ) ) , new_keys_data . null_buffer ( ) . cloned ( ) , 0 , new_keys_data . buffers ( ) . to_vec ( ) , values . data ( ) . child_data ( ) . to_vec ( ) , ) ; Ok ( DictionaryArray :: < T > :: from ( data ) ) }
`take` implementation for dictionary arrays
applies `take` to the keys of the dictionary array and returns a new dictionary array
with the same dictionary values and reordered keys
` take ` implementation for dictionary arrays applies ` take ` to the keys of the dictionary array and returns a new dictionary array with the same dictionary values and reordered keys
values
&DictionaryArray<T>
indices
&PrimitiveArray<I>
values
&DictionaryArray<T>
indices
&PrimitiveArray<I>