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


##########
datafusion/physical-expr/src/aggregate/array_agg_ordered.rs:
##########
@@ -308,18 +319,30 @@ impl OrderSensitiveArrayAggAccumulator {
         let fields = ordering_fields(&self.ordering_req, &self.datatypes[1..]);
         let struct_field = Fields::from(fields.clone());
 
-        let orderings: Vec<ScalarValue> = self
-            .ordering_values
-            .iter()
-            .map(|ordering| {
-                ScalarValue::Struct(Some(ordering.clone()), 
struct_field.clone())
-            })
-            .collect();
-        let struct_type = DataType::Struct(Fields::from(fields));
+        let mut column_wise_ordering_values = vec![];
+        let num_columns = fields.len();
+        for i in 0..num_columns {

Review Comment:
   > I think there might be a better design for StructArray (previous design is 
based on old ScalarValue::Struct). I avoid changing the logic or data structure 
in this PR.
   > 
   > May benefit #8558?
   
   I don't think it will benefit #8558 (won't harm either). However it will be 
a better change anyway. 



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

Reply via email to