alamb commented on code in PR #16606: URL: https://github.com/apache/datafusion/pull/16606#discussion_r2173688327
########## datafusion/sql/src/expr/function.rs: ########## @@ -227,6 +227,10 @@ impl<S: ContextProvider> SqlToRel<'_, S> { OVER is for window functions, whereas WITHIN GROUP is for ordered set aggregate functions"); } + if !order_by.is_empty() && !within_group.is_empty() { + return plan_err!("ORDER BY and WITHIN GROUP clauses cannot be used together in the same aggregate function. "); Review Comment: Sorry -- I missed this suggestion before merging. @watchingthewheelsgo any chance you are willing to make a small follow on PR? -- 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