@@ -5,20 +5,15 @@ use std::cmp::max;
55use std:: ops:: Range ;
66
77use vortex_array:: ArrayRef ;
8- use vortex_array:: ExecutionCtx ;
98use vortex_array:: IntoArray ;
10- use vortex_array:: arrays:: slice:: SliceKernel ;
9+ use vortex_array:: arrays:: slice:: SliceReduce ;
1110use vortex_error:: VortexResult ;
1211
1312use crate :: BitPacked ;
1413use crate :: BitPackedArray ;
1514
16- impl SliceKernel for BitPacked {
17- fn slice (
18- array : & BitPackedArray ,
19- range : Range < usize > ,
20- _ctx : & mut ExecutionCtx ,
21- ) -> VortexResult < Option < ArrayRef > > {
15+ impl SliceReduce for BitPacked {
16+ fn slice ( array : & BitPackedArray , range : Range < usize > ) -> VortexResult < Option < ArrayRef > > {
2217 let offset_start = range. start + array. offset ( ) as usize ;
2318 let offset_stop = range. end + array. offset ( ) as usize ;
2419 let offset = offset_start % 1024 ;
@@ -51,35 +46,26 @@ impl SliceKernel for BitPacked {
5146
5247#[ cfg( test) ]
5348mod tests {
54- use std:: sync:: LazyLock ;
55-
5649 use vortex_array:: DynArray ;
5750 use vortex_array:: IntoArray ;
58- use vortex_array:: VortexSessionExecute ;
5951 use vortex_array:: arrays:: PrimitiveArray ;
6052 use vortex_array:: arrays:: SliceArray ;
61- use vortex_array:: session:: ArraySession ;
6253 use vortex_error:: VortexResult ;
63- use vortex_session:: VortexSession ;
6454
6555 use crate :: BitPacked ;
6656 use crate :: bitpack_compress:: bitpack_encode;
6757
68- static SESSION : LazyLock < VortexSession > =
69- LazyLock :: new ( || VortexSession :: empty ( ) . with :: < ArraySession > ( ) ) ;
70-
7158 #[ test]
72- fn test_execute_parent_returns_bitpacked_slice ( ) -> VortexResult < ( ) > {
59+ fn test_reduce_parent_returns_bitpacked_slice ( ) -> VortexResult < ( ) > {
7360 let values = PrimitiveArray :: from_iter ( 0u32 ..2048 ) ;
7461 let bitpacked = bitpack_encode ( & values, 11 , None ) ?;
7562
7663 let slice_array = SliceArray :: new ( bitpacked. clone ( ) . into_array ( ) , 500 ..1500 ) ;
7764
78- let mut ctx = SESSION . create_execution_ctx ( ) ;
7965 let bitpacked_ref = bitpacked. into_array ( ) ;
8066 let reduced = bitpacked_ref
8167 . vtable ( )
82- . execute_parent ( & bitpacked_ref, & slice_array. into_array ( ) , 0 , & mut ctx ) ?
68+ . reduce_parent ( & bitpacked_ref, & slice_array. into_array ( ) , 0 ) ?
8369 . expect ( "expected slice kernel to execute" ) ;
8470
8571 assert ! ( reduced. is:: <BitPacked >( ) ) ;
0 commit comments