jayzhan211 commented on code in PR #9234:
URL: https://github.com/apache/arrow-datafusion/pull/9234#discussion_r1492604001


##########
datafusion/physical-expr/src/aggregate/array_agg_distinct.rs:
##########
@@ -181,47 +187,55 @@ mod tests {
     use arrow_array::Array;
     use arrow_array::ListArray;
     use arrow_buffer::OffsetBuffer;
-    use datafusion_common::utils::array_into_list_array;
     use datafusion_common::{internal_err, DataFusionError};
 
-    // arrow::compute::sort cann't sort ListArray directly, so we need to sort 
the inner primitive array and wrap it back into ListArray.
-    fn sort_list_inner(arr: ScalarValue) -> ScalarValue {
-        let arr = match arr {
-            ScalarValue::List(arr) => arr.value(0),
-            _ => {
-                panic!("Expected ScalarValue::List, got {:?}", arr)
-            }
-        };
+    // arrow::compute::sort can't sort nested ListArray directly, so we 
compare the scalar values pair-wise.

Review Comment:
   Agree, let me file the ticket. But, I think it is not so helpful for this 
test (values are little). Maybe support it if there is somewhere that needs 
sorting many nested lists.



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