Skip to content

Commit 5369396

Browse files
committed
chore(cubestore): Upgrade DF: fix aggregate index hll tests
1 parent b4d8607 commit 5369396

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

rust/cubestore/cubestore/src/metastore/table.rs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,19 @@ impl AggregateColumn {
9393
.build()?,
9494
AggregateFunction::MERGE => {
9595
let fun = aggregate_udf_by_kind(CubeAggregateUDFKind::MergeHll);
96-
// TODO upgrade DF: cleanup: don't wrap fun in Arc::new
97-
AggregateExprBuilder::new(Arc::new(fun), vec![col]).build()?
96+
97+
// TODO upgrade DF: Understand what effect the choice of alias value has.
98+
// TODO upgrade DF: We probably want .schema and .alias on other cases.
99+
// TODO upgrade DF: schema.clone() is wasteful; pass an &Arc<ArrowSchema> to this function.
100+
// TODO upgrade DF: Do we want more than .alias and .schema? It seems some stuff is mandatory, in general
101+
102+
// A comment in DF downstream name() fn suggests 'Human readable name such as
103+
// `"MIN(c2)"`.' It is mandatory that a .alias be supplied.
104+
let alias = format!("MERGE({})", col.name());
105+
AggregateExprBuilder::new(Arc::new(fun), vec![col])
106+
.schema(Arc::new(schema.clone()))
107+
.alias(alias)
108+
.build()?
98109
}
99110
};
100111
Ok(res)

rust/cubestore/cubestore/src/store/mod.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1329,12 +1329,15 @@ impl ChunkStore {
13291329
// .map(|x| x as usize)
13301330
// .collect();
13311331

1332+
// TODO upgrade DF: this is probably correct, but find out if we now need to supply some filter_expr from some loose end.
1333+
let filter_expr: Vec<Option<Arc<dyn PhysicalExpr>>> = vec![None; aggregates.len()];
1334+
13321335
// TODO merge sort
13331336
let aggregate = Arc::new(AggregateExec::try_new(
13341337
AggregateMode::Single,
13351338
PhysicalGroupBy::new_single(groups),
13361339
aggregates,
1337-
Vec::new(),
1340+
filter_expr,
13381341
input,
13391342
schema.clone(),
13401343
)?);

0 commit comments

Comments
 (0)