Skip to content

Commit 2a451d5

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

2 files changed

Lines changed: 49 additions & 1 deletion

File tree

encodings/alp/src/alp_rd/array.rs

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,26 @@ impl VTable for ALPRD {
272272
let array = require_child!(array, array.left_parts(), 0 => Primitive);
273273
let array = require_child!(array, array.right_parts(), 1 => Primitive);
274274

275+
// Iteratively execute patch children if they exist.
276+
if array
277+
.left_parts_patches()
278+
.is_some_and(|p| !p.indices().is::<Primitive>())
279+
{
280+
return Ok(ExecutionResult::execute_slot::<Primitive>(
281+
array,
282+
LP_PATCH_INDICES_SLOT,
283+
));
284+
}
285+
if array
286+
.left_parts_patches()
287+
.is_some_and(|p| !p.values().is::<Primitive>())
288+
{
289+
return Ok(ExecutionResult::execute_slot::<Primitive>(
290+
array,
291+
LP_PATCH_VALUES_SLOT,
292+
));
293+
}
294+
275295
let right_bit_width = array.right_bit_width();
276296
let ALPRDArrayParts {
277297
left_parts,
@@ -297,7 +317,6 @@ impl VTable for ALPRD {
297317
let validity = left_parts.validity_mask()?;
298318

299319
let decoded_array = if ptype == PType::F32 {
300-
// TODO(joe): use iterative execution for the patches.
301320
PrimitiveArray::new(
302321
alp_rd_decode::<f32>(
303322
left_parts.into_buffer::<u16>(),

encodings/fastlanes/src/bitpacking/vtable/mod.rs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
use std::hash::Hash;
55
use std::sync::Arc;
66

7+
use vortex_array::AnyCanonical;
78
use vortex_array::ArrayEq;
89
use vortex_array::ArrayHash;
910
use vortex_array::ArrayRef;
@@ -14,6 +15,7 @@ use vortex_array::IntoArray;
1415
use vortex_array::Precision;
1516
use vortex_array::ProstMetadata;
1617
use vortex_array::SerializeMetadata;
18+
use vortex_array::arrays::Primitive;
1719
use vortex_array::buffer::BufferHandle;
1820
use vortex_array::builders::ArrayBuilder;
1921
use vortex_array::dtype::DType;
@@ -310,6 +312,33 @@ impl VTable for BitPacked {
310312
}
311313

312314
fn execute(array: Arc<Array<Self>>, ctx: &mut ExecutionCtx) -> VortexResult<ExecutionResult> {
315+
// Iteratively execute patch children if they exist.
316+
if array
317+
.patches()
318+
.is_some_and(|p| !p.indices().is::<Primitive>())
319+
{
320+
return Ok(ExecutionResult::execute_slot::<Primitive>(
321+
array,
322+
PATCH_INDICES_SLOT,
323+
));
324+
}
325+
if array
326+
.patches()
327+
.is_some_and(|p| !p.values().is::<Primitive>())
328+
{
329+
return Ok(ExecutionResult::execute_slot::<Primitive>(
330+
array,
331+
PATCH_VALUES_SLOT,
332+
));
333+
}
334+
// Iteratively execute validity if it exists as an encoded array.
335+
if matches!(&array.validity, Validity::Array(v) if !v.is::<AnyCanonical>()) {
336+
return Ok(ExecutionResult::execute_slot::<AnyCanonical>(
337+
array,
338+
VALIDITY_SLOT,
339+
));
340+
}
341+
313342
Ok(ExecutionResult::done(
314343
unpack_array(&array, ctx)?.into_array(),
315344
))

0 commit comments

Comments
 (0)