jonahgao commented on code in PR #10459: URL: https://github.com/apache/datafusion/pull/10459#discussion_r1597637521
########## datafusion/optimizer/src/single_distinct_to_groupby.rs: ########## @@ -280,11 +261,7 @@ impl OptimizerRule for SingleDistinctToGroupBy { outer_group_exprs, outer_aggr_exprs, )?); - - Ok(Some(LogicalPlan::Projection(Projection::try_new( - alias_expr, - Arc::new(outer_aggr), - )?))) + Ok(Some(project(outer_aggr, alias_expr)?)) Review Comment: The function `project()` will internally call `columnize_expr`, which can simplify the code here. -- 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