Skip to content

Commit 54b5063

Browse files
committed
accumulators: Set collation based on output DfType
For `group_concat()` and `json_object_agg()`, we were hardcoding the output collation to UTF-8. It's easy enough to figure out the actual intended collation, we just need to look at the `DfType` that's passed in to the `over()` function. We still default to UTF-8 lacking anything else. Fixes: REA-5948 Release-Note-Core: Use the intended collation for string accumulating aggregation function. Change-Id: Ia2486de5838c162d23cbbd57538faeff90812c0e Reviewed-on: https://gerrit.readyset.name/c/readyset/+/10442 Reviewed-by: Michael Zink <michael.z@readyset.io> Tested-by: Buildkite CI
1 parent 0054d30 commit 54b5063

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

readyset-dataflow/src/ops/grouped/accumulator.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,19 @@ impl Accumulator {
3939
src: NodeIndex,
4040
over: usize,
4141
group_by: &[usize],
42-
_over_col_ty: &DfType,
42+
over_col_ty: &DfType,
4343
_dialect: &Dialect,
4444
) -> ReadySetResult<GroupedOperator<Accumulator>> {
45+
let collation = over_col_ty.collation().unwrap_or(Collation::Utf8);
46+
4547
let out_ty = match &op {
4648
AccumulationOp::GroupConcat { .. } => {
4749
antithesis_sdk::assert_reachable!("Accumulation::GroupConcat");
48-
DfType::Text(/* TODO */ Collation::Utf8)
50+
DfType::Text(collation)
4951
}
5052
AccumulationOp::JsonObjectAgg { .. } => {
5153
antithesis_sdk::assert_reachable!("Accumulation::JsonObjectAgg");
52-
DfType::Text(Collation::Utf8)
54+
DfType::Text(collation)
5355
}
5456
};
5557

0 commit comments

Comments
 (0)