jayzhan211 commented on code in PR #8279: URL: https://github.com/apache/arrow-datafusion/pull/8279#discussion_r1403270928
########## datafusion/physical-expr/src/array_expressions.rs: ########## @@ -816,10 +816,17 @@ pub fn array_sort(args: &[ArrayRef]) -> Result<ArrayRef> { }; let list_array = as_list_array(&args[0])?; + let default_empty = ArrayData::new_empty(&list_array.value_type()); + let sorted = list_array + .iter() + .map(|array| { + array.map_or(arrow::array::make_array(default_empty.clone()), |arr_ref| { + arrow_ord::sort::sort(&arr_ref, sort_option).unwrap() Review Comment: Try arrow::compute::sort to avoid unwrap -- 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