Skip to main content

take_fixed_size

Function take_fixed_size 

Source
fn take_fixed_size<IndexType: ArrowPrimitiveType, const N: usize>(
    buffer: &Buffer,
    indices: &PrimitiveArray<IndexType>,
) -> Buffer
Expand description

Implements the take kernel semantics over a flat [Buffer], interpreting it as a slice of &[[u8; N]], where N is a compile-time constant. The usage of a flat [Buffer] allows using this kernel without an available [ArrowPrimitiveType] (e.g., for [u8; 5]).

§Using This Function in the Primitive Take Kernel

This function is basically the same as take_native but just on a flat [Buffer] instead of the primitive [ScalarBuffer]. Ideally, the take_primitive kernel should just use this more general function. However, the “idiomatic code” requires the feature(generic_const_exprs) for calling take_fixed_size<I, { size_of::<T::Native> () } >(...). Once this feature has been stabilized, we can use this function also in the primitive kernels.