@@ -3,10 +3,10 @@ use std::mem::MaybeUninit;
33
44use fastlanes:: BitPacking ;
55use vortex_array:: arrays:: PrimitiveArray ;
6- use vortex_array:: compute:: { TakeFn , take} ;
6+ use vortex_array:: compute:: { TakeKernel , TakeKernelAdapter , take} ;
77use vortex_array:: validity:: Validity ;
88use vortex_array:: variants:: PrimitiveArrayTrait ;
9- use vortex_array:: { Array , ArrayRef , ToCanonical } ;
9+ use vortex_array:: { Array , ArrayRef , ToCanonical , register_kernel } ;
1010use vortex_buffer:: { Buffer , BufferMut } ;
1111use vortex_dtype:: {
1212 NativePType , PType , match_each_integer_ptype, match_each_unsigned_integer_ptype,
@@ -21,7 +21,7 @@ use crate::{BitPackedArray, BitPackedEncoding, unpack_single_primitive};
2121// see https://github.com/spiraldb/vortex/pull/190#issue-2223752833
2222pub ( super ) const UNPACK_CHUNK_THRESHOLD : usize = 8 ;
2323
24- impl TakeFn < & BitPackedArray > for BitPackedEncoding {
24+ impl TakeKernel for BitPackedEncoding {
2525 fn take ( & self , array : & BitPackedArray , indices : & dyn Array ) -> VortexResult < ArrayRef > {
2626 // If the indices are large enough, it's faster to flatten and take the primitive array.
2727 if indices. len ( ) * UNPACK_CHUNK_THRESHOLD > array. len ( ) {
@@ -44,6 +44,8 @@ impl TakeFn<&BitPackedArray> for BitPackedEncoding {
4444 }
4545}
4646
47+ register_kernel ! ( TakeKernelAdapter ( BitPackedEncoding ) . lift( ) ) ;
48+
4749fn take_primitive < T : NativePType + BitPacking , I : NativePType > (
4850 array : & BitPackedArray ,
4951 indices : & PrimitiveArray ,
0 commit comments