Friede80 commented on code in PR #15135: URL: https://github.com/apache/datafusion/pull/15135#discussion_r1994051405
########## datafusion/expr/src/logical_plan/builder.rs: ########## @@ -776,8 +777,32 @@ impl LogicalPlanBuilder { &missing_cols, is_distinct, )?; + + let mut sort_exprs = normalize_sorts(sorts, &plan)?; + if matches!(&plan, LogicalPlan::Union(_)) Review Comment: I agree it feels strange and I wouldn't mind getting rid of this, but I put it in for backwards compatibility, because currently if you ran: ```sql select t1.a from t1 union all select t2.a from t2 order by t1.a ``` it would work. But after this PR, it would fail without this pass -- 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