@@ -16,11 +16,13 @@ use vortex_array::IntoArray;
1616use vortex_array:: Precision ;
1717use vortex_array:: ProstMetadata ;
1818use vortex_array:: SerializeMetadata ;
19+ use vortex_array:: arrays:: Primitive ;
1920use vortex_array:: buffer:: BufferHandle ;
2021use vortex_array:: dtype:: DType ;
2122use vortex_array:: dtype:: PType ;
2223use vortex_array:: patches:: Patches ;
2324use vortex_array:: patches:: PatchesMetadata ;
25+ use vortex_array:: require_child;
2426use vortex_array:: serde:: ArrayChildren ;
2527use vortex_array:: stats:: ArrayStats ;
2628use vortex_array:: stats:: StatsSetRef ;
@@ -202,6 +204,37 @@ impl VTable for ALP {
202204 }
203205
204206 fn execute ( array : Arc < Array < Self > > , ctx : & mut ExecutionCtx ) -> VortexResult < ExecutionResult > {
207+ let array = require_child ! ( array, array. encoded( ) , ENCODED_SLOT => Primitive ) ;
208+
209+ if array
210+ . patches ( )
211+ . is_some_and ( |p| !p. indices ( ) . is :: < Primitive > ( ) )
212+ {
213+ return Ok ( ExecutionResult :: execute_slot :: < Primitive > (
214+ array,
215+ PATCH_INDICES_SLOT ,
216+ ) ) ;
217+ }
218+ if array
219+ . patches ( )
220+ . is_some_and ( |p| !p. values ( ) . is :: < Primitive > ( ) )
221+ {
222+ return Ok ( ExecutionResult :: execute_slot :: < Primitive > (
223+ array,
224+ PATCH_VALUES_SLOT ,
225+ ) ) ;
226+ }
227+ if array. patches ( ) . is_some_and ( |p| {
228+ p. chunk_offsets ( )
229+ . as_ref ( )
230+ . is_some_and ( |co| !co. is :: < Primitive > ( ) )
231+ } ) {
232+ return Ok ( ExecutionResult :: execute_slot :: < Primitive > (
233+ array,
234+ PATCH_CHUNK_OFFSETS_SLOT ,
235+ ) ) ;
236+ }
237+
205238 Ok ( ExecutionResult :: done (
206239 execute_decompress ( Arc :: unwrap_or_clone ( array) . into_inner ( ) , ctx) ?. into_array ( ) ,
207240 ) )
0 commit comments