CuteChuanChuan commented on code in PR #27827:
URL: https://github.com/apache/datafusion/pull/27827#discussion_r4732110060
##########
datafusion/physical-plan/src/aggregates/mod.rs:
##########
@@ -3081,6 +3093,31 @@ fn determine_finer(
}
}
+/// Returns the aggregate expressions of the `Partial` [`AggregateExec`]
+/// whose state `input` carries.
+///
+/// Rebuilding a `Partial` aggregate over a differently ordered input can
+/// reverse an order-sensitive expression, which changes the layout of its
+/// state. The stage that merges that state must use the same expressions.
+fn find_partial_aggr_exprs(
+ input: &Arc<dyn ExecutionPlan>,
+) -> Option<Vec<Arc<AggregateFunctionExpr>>> {
+ let mut plan = input;
+ loop {
+ if let Some(agg_exec) = plan.downcast_ref::<AggregateExec>() {
+ return if *agg_exec.mode() == AggregateMode::Partial {
Review Comment:
Thanks for catching that the description claimed `PartialReduce` was covered
while the helper only accepted Partial. Addressed in 5abee66, with your test.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]