Skip to content

Commit 01aa989

Browse files
committed
wip
Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
1 parent 4cc20b4 commit 01aa989

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

  • encodings/datetime-parts/src/compute
  • vortex-array/src/aggregate_fn/fns

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ impl ArrayParentReduceRule<DateTimeParts> for DTPFilterPushDownRule {
5454
) -> VortexResult<Option<ArrayRef>> {
5555
debug_assert_eq!(child_idx, 0);
5656

57-
if !child.seconds().is::<Constant>() || !child.subseconds().is::<Constant>() {
57+
if *child.seconds().encoding_id() != Constant::ID
58+
|| *child.subseconds().encoding_id() != Constant::ID
59+
{
5860
return Ok(None);
5961
}
6062

vortex-array/src/aggregate_fn/fns/is_constant/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ pub fn is_constant(array: &ArrayRef, ctx: &mut ExecutionCtx) -> VortexResult<boo
107107
}
108108

109109
// Constant and null arrays are always constant.
110-
if array.is::<Constant>() || array.is::<Null>() {
110+
let id = array.encoding_id();
111+
if *id == Constant::ID || *id == Null::ID {
111112
array
112113
.statistics()
113114
.set(Stat::IsConstant, Precision::Exact(true.into()));

vortex-array/src/aggregate_fn/fns/is_sorted/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ fn is_sorted_impl(array: &ArrayRef, strict: bool, ctx: &mut ExecutionCtx) -> Vor
8888
}
8989

9090
// Constant and null arrays are always sorted, but not strict sorted.
91-
if array.is::<Constant>() || array.is::<Null>() {
91+
let id = array.encoding_id();
92+
if *id == Constant::ID || *id == Null::ID {
9293
let result = !strict;
9394
cache_is_sorted(array, strict, result);
9495
return Ok(result);

0 commit comments

Comments
 (0)