Skip to content

Commit e7cccce

Browse files
committed
chore(cubestore): Upgrade DF: Fix bug in RollingWindowAggregate partial_cmp implementation
1 parent ee4a1b6 commit e7cccce

File tree

1 file changed

+8
-7
lines changed
  • rust/cubestore/cubestore/src/queryplanner

1 file changed

+8
-7
lines changed

rust/cubestore/cubestore/src/queryplanner/rolling.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ pub struct RollingWindowAggregate {
6565

6666
impl PartialOrd for RollingWindowAggregate {
6767
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
68-
// TODO upgrade DF: Figure out what dyn_ord is used for.
69-
7068
macro_rules! exit_early {
7169
( $x:expr ) => {{
7270
let res = $x;
@@ -109,6 +107,7 @@ impl PartialOrd for RollingWindowAggregate {
109107
exit_early!(lower_bound.partial_cmp(&other.lower_bound)?);
110108
exit_early!(upper_bound.partial_cmp(&other.upper_bound)?);
111109
exit_early!(upper_bound.partial_cmp(&other.upper_bound)?);
110+
exit_early!(offset_to_end.cmp(&other.offset_to_end));
112111

113112
if schema.eq(&other.schema) {
114113
Some(Ordering::Equal)
@@ -157,6 +156,8 @@ impl RollingWindowAggregate {
157156
rolling_aggs_alias: &Vec<String>,
158157
from: &Expr,
159158
) -> Result<DFSchemaRef, CubeError> {
159+
// TODO upgrade DF: Remove unused variable `dimension`
160+
let _ = dimension;
160161
let fields = exprlist_to_fields(
161162
vec![from.clone()]
162163
.into_iter()
@@ -521,8 +522,8 @@ impl ExtensionPlanner for RollingWindowPlanner {
521522
.map(|e| -> Result<_, DataFusionError> {
522523
match e {
523524
Expr::AggregateFunction(AggregateFunction {
524-
func,
525-
params: AggregateFunctionParams { args, .. },
525+
func: _,
526+
params: AggregateFunctionParams { args: _, .. },
526527
}) => {
527528
let (agg, _, _) = create_aggregate_expr_and_maybe_filter(
528529
e,
@@ -632,7 +633,7 @@ pub struct RollingWindowAggExec {
632633
}
633634

634635
impl DisplayAs for RollingWindowAggExec {
635-
fn fmt_as(&self, t: DisplayFormatType, f: &mut Formatter) -> std::fmt::Result {
636+
fn fmt_as(&self, _t: DisplayFormatType, f: &mut Formatter) -> std::fmt::Result {
636637
write!(f, "RollingWindowAggExec")
637638
}
638639
}
@@ -786,7 +787,7 @@ impl ExecutionPlan for RollingWindowAggExec {
786787
.iter()
787788
.map(|a| ScalarValue::try_from(a.field().data_type()))
788789
.collect::<Result<Vec<_>, _>>()?;
789-
let mut out_extra_aggs = plan.aggs.iter().map(|a| Vec::new()).collect::<Vec<_>>();
790+
let mut out_extra_aggs = vec![Vec::<ScalarValue>::new(); plan.aggs.len()];
790791
// let other_cols_data = other_cols.iter().map(|c| c.to_data()).collect::<Vec<_>>();
791792
// let mut out_other = other_cols_data
792793
// .iter()
@@ -1019,7 +1020,7 @@ impl ExecutionPlan for RollingWindowAggExec {
10191020
for i in 0..accumulators.len() {
10201021
// let null = accumulators[i].evaluate()?;
10211022

1022-
for j in 0..num_empty_dims {
1023+
for _j in 0..num_empty_dims {
10231024
let inputs = agg_inputs[i].iter().map(|a| a.slice(0, 0)).collect_vec();
10241025
accumulators[i].update_batch(inputs.as_slice(), &[], None, group_index + 1)?;
10251026
group_index += 1;

0 commit comments

Comments
 (0)