Skip to content

Commit 600287e

Browse files
committed
yet more fixes
Signed-off-by: Daniel King <dan@spiraldb.com>
1 parent 475549b commit 600287e

47 files changed

Lines changed: 244 additions & 129 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

encodings/alp/src/alp/ops.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ impl OperationsVTable<ALP> for ALP {
1818
fn scalar_at(
1919
array: ArrayView<'_, ALP>,
2020
index: usize,
21-
_ctx: &mut ExecutionCtx,
21+
ctx: &mut ExecutionCtx,
2222
) -> VortexResult<Scalar> {
2323
if let Some(patches) = array.patches()
2424
&& let Some(patch) = patches.get_patched(index)?
2525
{
2626
return patch.cast(array.dtype());
2727
}
2828

29-
let encoded_val = array.encoded().scalar_at(index)?;
29+
let encoded_val = array.encoded().scalar_at(index, ctx)?;
3030

3131
Ok(match_each_alp_float_ptype!(array.dtype().as_ptype(), |T| {
3232
let encoded_val: <T as ALPFloat>::ALPInt =

encodings/alp/src/alp_rd/ops.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ impl OperationsVTable<ALPRD> for ALPRD {
1616
fn scalar_at(
1717
array: ArrayView<'_, ALPRD>,
1818
index: usize,
19-
_ctx: &mut ExecutionCtx,
19+
ctx: &mut ExecutionCtx,
2020
) -> VortexResult<Scalar> {
2121
// The left value can either be a direct value, or an exception.
2222
// The exceptions array represents exception positions with non-null values.
@@ -32,7 +32,7 @@ impl OperationsVTable<ALPRD> for ALPRD {
3232
_ => {
3333
let left_code: u16 = array
3434
.left_parts()
35-
.scalar_at(index)?
35+
.scalar_at(index, ctx)?
3636
.as_primitive()
3737
.as_::<u16>()
3838
.vortex_expect("left_code must be non-null");
@@ -44,7 +44,7 @@ impl OperationsVTable<ALPRD> for ALPRD {
4444
Ok(if array.dtype().as_ptype() == PType::F32 {
4545
let right: u32 = array
4646
.right_parts()
47-
.scalar_at(index)?
47+
.scalar_at(index, ctx)?
4848
.as_primitive()
4949
.as_::<u32>()
5050
.vortex_expect("non-null");
@@ -53,7 +53,7 @@ impl OperationsVTable<ALPRD> for ALPRD {
5353
} else {
5454
let right: u64 = array
5555
.right_parts()
56-
.scalar_at(index)?
56+
.scalar_at(index, ctx)?
5757
.as_primitive()
5858
.as_::<u64>()
5959
.vortex_expect("non-null");

encodings/datetime-parts/src/compute/is_constant.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@ impl DynAggregateKernel for DateTimePartsIsConstantKernel {
3737
let result = is_constant(array.days(), ctx)?
3838
&& is_constant(array.seconds(), ctx)?
3939
&& is_constant(array.subseconds(), ctx)?;
40-
Ok(Some(IsConstant::make_partial(batch, result)?))
40+
Ok(Some(IsConstant::make_partial(batch, result, ctx)?))
4141
}
4242
}

encodings/datetime-parts/src/ops.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ impl OperationsVTable<DateTimeParts> for DateTimeParts {
2020
fn scalar_at(
2121
array: ArrayView<'_, DateTimeParts>,
2222
index: usize,
23-
_ctx: &mut ExecutionCtx,
23+
ctx: &mut ExecutionCtx,
2424
) -> VortexResult<Scalar> {
2525
let DType::Extension(ext) = array.dtype().clone() else {
2626
vortex_panic!(
@@ -33,25 +33,25 @@ impl OperationsVTable<DateTimeParts> for DateTimeParts {
3333
vortex_panic!(Compute: "must decode TemporalMetadata from extension metadata");
3434
};
3535

36-
if !array.as_ref().is_valid(index)? {
36+
if !array.as_ref().is_valid(index, ctx)? {
3737
return Ok(Scalar::null(DType::Extension(ext)));
3838
}
3939

4040
let days: i64 = array
4141
.days()
42-
.scalar_at(index)?
42+
.scalar_at(index, ctx)?
4343
.as_primitive()
4444
.as_::<i64>()
4545
.vortex_expect("days fits in i64");
4646
let seconds: i64 = array
4747
.seconds()
48-
.scalar_at(index)?
48+
.scalar_at(index, ctx)?
4949
.as_primitive()
5050
.as_::<i64>()
5151
.vortex_expect("seconds fits in i64");
5252
let subseconds: i64 = array
5353
.subseconds()
54-
.scalar_at(index)?
54+
.scalar_at(index, ctx)?
5555
.as_primitive()
5656
.as_::<i64>()
5757
.vortex_expect("subseconds fits in i64");

encodings/decimal-byte-parts/src/decimal_byte_parts/compute/is_constant.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ impl DynAggregateKernel for DecimalBytePartsIsConstantKernel {
3535
};
3636

3737
let result = is_constant(array.msp(), ctx)?;
38-
Ok(Some(IsConstant::make_partial(batch, result)?))
38+
Ok(Some(IsConstant::make_partial(batch, result, ctx)?))
3939
}
4040
}

encodings/decimal-byte-parts/src/decimal_byte_parts/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,10 +303,10 @@ impl OperationsVTable<DecimalByteParts> for DecimalByteParts {
303303
fn scalar_at(
304304
array: ArrayView<'_, DecimalByteParts>,
305305
index: usize,
306-
_ctx: &mut ExecutionCtx,
306+
ctx: &mut ExecutionCtx,
307307
) -> VortexResult<Scalar> {
308308
// TODO(joe): support parts len != 1
309-
let scalar = array.msp().scalar_at(index)?;
309+
let scalar = array.msp().scalar_at(index, ctx)?;
310310

311311
// Note. values in msp, can only be signed integers upto size i64.
312312
let primitive_scalar = scalar.as_primitive();

encodings/fastlanes/src/bitpacking/compute/is_constant.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ impl DynAggregateKernel for BitPackedIsConstantKernel {
3434
&self,
3535
aggregate_fn: &AggregateFnRef,
3636
batch: &ArrayRef,
37-
_ctx: &mut ExecutionCtx,
37+
ctx: &mut ExecutionCtx,
3838
) -> VortexResult<Option<Scalar>> {
3939
if !aggregate_fn.is::<IsConstant>() {
4040
return Ok(None);
@@ -48,7 +48,7 @@ impl DynAggregateKernel for BitPackedIsConstantKernel {
4848
bitpacked_is_constant::<P, { IS_CONST_LANE_WIDTH / size_of::<P>() }>(array)?
4949
});
5050

51-
Ok(Some(IsConstant::make_partial(batch, result)?))
51+
Ok(Some(IsConstant::make_partial(batch, result, ctx)?))
5252
}
5353
}
5454

encodings/fastlanes/src/delta/vtable/operations.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ impl OperationsVTable<Delta> for Delta {
1414
fn scalar_at(
1515
array: ArrayView<'_, Delta>,
1616
index: usize,
17-
_ctx: &mut ExecutionCtx,
17+
ctx: &mut ExecutionCtx,
1818
) -> VortexResult<Scalar> {
1919
let decompressed = array.array().slice(index..index + 1)?.to_primitive();
20-
decompressed.into_array().scalar_at(0)
20+
decompressed.into_array().scalar_at(0, ctx)
2121
}
2222
}
2323

encodings/fastlanes/src/for/compute/is_constant.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ impl DynAggregateKernel for FoRIsConstantKernel {
3535
};
3636

3737
let result = is_constant(array.encoded(), ctx)?;
38-
Ok(Some(IsConstant::make_partial(batch, result)?))
38+
Ok(Some(IsConstant::make_partial(batch, result, ctx)?))
3939
}
4040
}

encodings/fastlanes/src/for/compute/is_sorted.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,12 @@ impl DynAggregateKernel for FoRIsSortedKernel {
4949
is_sorted(&unsigned_array, ctx)?
5050
};
5151

52-
Ok(Some(IsSorted::make_partial(batch, result, options.strict)?))
52+
Ok(Some(IsSorted::make_partial(
53+
batch,
54+
result,
55+
options.strict,
56+
ctx,
57+
)?))
5358
}
5459
}
5560

0 commit comments

Comments
 (0)