@@ -8,22 +8,18 @@ mod min_max;
88mod optimize;
99
1010use vortex_array:: compute:: {
11- BinaryNumericFn , CompareFn , FillNullFn , FilterKernel , FilterKernelAdapter , IsConstantFn ,
12- IsSortedFn , KernelRef , LikeFn , MinMaxFn , OptimizeFn , ScalarAtFn , SliceFn , TakeFn , filter,
13- scalar_at , slice, take,
11+ BinaryNumericFn , CompareFn , FillNullFn , FilterKernelAdapter , FilterKernelImpl , IsConstantFn ,
12+ IsSortedFn , LikeFn , MinMaxFn , OptimizeFn , ScalarAtFn , SliceFn , TakeFn , filter, scalar_at ,
13+ slice, take,
1414} ;
1515use vortex_array:: vtable:: ComputeVTable ;
16- use vortex_array:: { Array , ArrayComputeImpl , ArrayRef } ;
16+ use vortex_array:: { Array , ArrayRef , register_kernel } ;
1717use vortex_error:: VortexResult ;
1818use vortex_mask:: Mask ;
1919use vortex_scalar:: Scalar ;
2020
2121use crate :: { DictArray , DictEncoding } ;
2222
23- impl ArrayComputeImpl for DictArray {
24- const FILTER : Option < KernelRef > = FilterKernelAdapter ( DictEncoding ) . some ( ) ;
25- }
26-
2723impl ComputeVTable for DictEncoding {
2824 fn binary_numeric_fn ( & self ) -> Option < & dyn BinaryNumericFn < & dyn Array > > {
2925 Some ( self )
@@ -84,13 +80,15 @@ impl TakeFn<&DictArray> for DictEncoding {
8480 }
8581}
8682
87- impl FilterKernel for DictEncoding {
83+ impl FilterKernelImpl for DictEncoding {
8884 fn filter ( & self , array : & DictArray , mask : & Mask ) -> VortexResult < ArrayRef > {
8985 let codes = filter ( array. codes ( ) , mask) ?;
9086 DictArray :: try_new ( codes, array. values ( ) . clone ( ) ) . map ( |a| a. into_array ( ) )
9187 }
9288}
9389
90+ register_kernel ! ( FilterKernelAdapter ( DictEncoding ) . lift( ) ) ;
91+
9492impl SliceFn < & DictArray > for DictEncoding {
9593 // TODO(robert): Add function to trim the dictionary
9694 fn slice ( & self , array : & DictArray , start : usize , stop : usize ) -> VortexResult < ArrayRef > {
0 commit comments