Skip to content

Commit 7dcc3f7

Browse files
perf[date-time-parts]: compressor handle constant and pushdown rules p2 (#5786)
should have been in #5778 --------- Signed-off-by: Joe Isaacs <[email protected]>
1 parent 31026ce commit 7dcc3f7

File tree

1 file changed

+3
-7
lines changed
  • encodings/datetime-parts/src/compute

1 file changed

+3
-7
lines changed

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

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
// SPDX-License-Identifier: Apache-2.0
22
// SPDX-FileCopyrightText: Copyright the Vortex contributors
33

4+
use vortex_array::Array;
45
use vortex_array::ArrayRef;
56
use vortex_array::IntoArray;
67
use vortex_array::arrays::ConstantArray;
78
use vortex_array::arrays::ConstantVTable;
89
use vortex_array::arrays::FilterArray;
910
use vortex_array::arrays::FilterVTable;
1011
use vortex_array::matchers::Exact;
11-
use vortex_array::optimizer::ArrayOptimizer;
1212
use vortex_array::optimizer::rules::ArrayParentReduceRule;
1313
use vortex_array::optimizer::rules::ParentRuleSet;
1414
use vortex_error::VortexExpect;
@@ -38,19 +38,15 @@ impl ArrayParentReduceRule<DateTimePartsVTable> for DTPFilterPushDownRule {
3838
parent: &FilterArray,
3939
child_idx: usize,
4040
) -> VortexResult<Option<ArrayRef>> {
41-
if child_idx != 0 {
42-
return Ok(None);
43-
}
41+
debug_assert_eq!(child_idx, 0);
4442

4543
if !child.seconds().is::<ConstantVTable>() || !child.subseconds().is::<ConstantVTable>() {
4644
return Ok(None);
4745
}
4846

4947
DateTimePartsArray::try_new(
5048
child.dtype().clone(),
51-
FilterArray::new(child.days().clone(), parent.filter_mask().clone())
52-
.into_array()
53-
.optimize()?,
49+
child.days().clone().filter(parent.filter_mask().clone())?,
5450
ConstantArray::new(
5551
child.seconds().as_constant().vortex_expect("constant"),
5652
parent.filter_mask().true_count(),

0 commit comments

Comments
 (0)