mustafasrepo commented on code in PR #6332:
URL: https://github.com/apache/arrow-datafusion/pull/6332#discussion_r1193850382


##########
datafusion/core/src/physical_plan/aggregates/mod.rs:
##########
@@ -356,6 +409,23 @@ impl AggregateExec {
         )?;
 
         let schema = Arc::new(schema);
+        let mut aggregator_requirement = None;
+        // Ordering requirement makes sense only in Partial and Single modes.
+        // In other modes, all groups are collapsed, therefore their input 
schema
+        // can not contain expressions in the requirement.
+        if mode == AggregateMode::Partial || mode == AggregateMode::Single {
+            let requirement = get_finest_requirement(
+                &order_by_expr,
+                || input.equivalence_properties(),
+                || input.ordering_equivalence_properties(),
+            )?;
+            aggregator_requirement = requirement.map(|exprs| {

Review Comment:
   This is neat!. Thanks



-- 
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: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to