ologlogn commented on code in PR #22597:
URL: https://github.com/apache/datafusion/pull/22597#discussion_r3323426533


##########
datafusion/functions-aggregate/src/array_agg.rs:
##########
@@ -1008,7 +1008,13 @@ impl OrderSensitiveArrayAggAccumulator {
         } else {
             (0..fields.len())
                 .map(|i| {
-                    let column_values = self.ordering_values.iter().map(|x| 
x[i].clone());
+                    let column_values: Box<dyn Iterator<Item = ScalarValue>> = 
if self
+                        .reverse
+                    {
+                        Box::new(self.ordering_values.iter().rev().map(|x| 
x[i].clone()))
+                    } else {
+                        Box::new(self.ordering_values.iter().map(|x| 
x[i].clone()))
+                    };

Review Comment:
   It;s kind of hard to reproduce with just sql, this happens because of the 
order of execution.. 



-- 
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]

Reply via email to