Skip to content

Commit c4d327e

Browse files
committed
u
Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
1 parent 2a451d5 commit c4d327e

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

encodings/alp/src/alp/array.rs

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@ use vortex_array::IntoArray;
1616
use vortex_array::Precision;
1717
use vortex_array::ProstMetadata;
1818
use vortex_array::SerializeMetadata;
19+
use vortex_array::arrays::Primitive;
1920
use vortex_array::buffer::BufferHandle;
2021
use vortex_array::dtype::DType;
2122
use vortex_array::dtype::PType;
2223
use vortex_array::patches::Patches;
2324
use vortex_array::patches::PatchesMetadata;
25+
use vortex_array::require_child;
2426
use vortex_array::serde::ArrayChildren;
2527
use vortex_array::stats::ArrayStats;
2628
use 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

Comments
 (0)