@@ -20,6 +20,7 @@ use vortex_array::ExecutionResult;
2020use vortex_array:: IntoArray ;
2121use vortex_array:: Precision ;
2222use vortex_array:: TypedArrayRef ;
23+ use vortex_array:: array_slots;
2324use vortex_array:: arrays:: Primitive ;
2425use vortex_array:: buffer:: BufferHandle ;
2526use vortex_array:: dtype:: DType ;
@@ -81,13 +82,14 @@ impl VTable for ALP {
8182 len : usize ,
8283 slots : & [ Option < ArrayRef > ] ,
8384 ) -> VortexResult < ( ) > {
85+ let slots = ALPSlotsView :: from_slots ( slots) ;
8486 validate_parts (
8587 dtype,
8688 len,
8789 data. exponents ,
88- ALPSlotsView :: from_slots ( slots) . encoded ,
90+ slots. encoded ,
8991 patches_from_slots (
90- slots,
92+ & slots,
9193 data. patch_offset ,
9294 data. patch_offset_within_chunk ,
9395 len,
@@ -203,7 +205,7 @@ impl VTable for ALP {
203205 }
204206}
205207
206- #[ vortex_array :: array_slots( ALP ) ]
208+ #[ array_slots( ALP ) ]
207209pub struct ALPSlots {
208210 /// The ALP-encoded values array.
209211 pub encoded : ArrayRef ,
@@ -440,7 +442,7 @@ pub trait ALPArrayExt: ALPArraySlotsExt {
440442
441443 fn patches ( & self ) -> Option < Patches > {
442444 patches_from_slots (
443- self . as_ref ( ) . slots ( ) ,
445+ & self . slots_view ( ) ,
444446 self . patch_offset ,
445447 self . patch_offset_within_chunk ,
446448 self . as_ref ( ) . len ( ) ,
@@ -449,13 +451,12 @@ pub trait ALPArrayExt: ALPArraySlotsExt {
449451}
450452
451453fn patches_from_slots (
452- slots : & [ Option < ArrayRef > ] ,
454+ slots : & ALPSlotsView ,
453455 patch_offset : Option < usize > ,
454456 patch_offset_within_chunk : Option < usize > ,
455457 len : usize ,
456458) -> Option < Patches > {
457- let view = ALPSlotsView :: from_slots ( slots) ;
458- match ( view. patch_indices , view. patch_values ) {
459+ match ( slots. patch_indices , slots. patch_values ) {
459460 ( Some ( indices) , Some ( values) ) => {
460461 let patch_offset = patch_offset. vortex_expect ( "has patch slots but no patch_offset" ) ;
461462 Some ( unsafe {
@@ -464,7 +465,7 @@ fn patches_from_slots(
464465 patch_offset,
465466 indices. clone ( ) ,
466467 values. clone ( ) ,
467- view . patch_chunk_offsets . cloned ( ) ,
468+ slots . patch_chunk_offsets . cloned ( ) ,
468469 patch_offset_within_chunk,
469470 )
470471 } )
0 commit comments