crepererum commented on code in PR #16615: URL: https://github.com/apache/datafusion/pull/16615#discussion_r2174591239
########## datafusion/substrait/src/logical_plan/consumer/rel/aggregate_rel.rs: ########## @@ -89,12 +89,9 @@ pub async fn from_aggregate_rel( _ => false, }; let order_by = if !f.sorts.is_empty() { - Some( - from_substrait_sorts(consumer, &f.sorts, input.schema()) - .await?, - ) + from_substrait_sorts(consumer, &f.sorts, input.schema()).await? Review Comment: can we make `from_substrait_sorts` work with an empty slice? ########## datafusion/core/src/physical_planner.rs: ########## @@ -1651,13 +1651,14 @@ pub fn create_aggregate_expr_with_name_and_maybe_filter( == NullTreatment::IgnoreNulls; let (agg_expr, filter, order_bys) = { - let order_bys = match order_by { - Some(exprs) => create_physical_sort_exprs( - exprs, + let order_bys = if !order_by.is_empty() { + create_physical_sort_exprs( Review Comment: can we make `create_physical_sort_exprs` work with empty slices? -- 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...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org