Garamda commented on code in PR #13511: URL: https://github.com/apache/datafusion/pull/13511#discussion_r1938219937
########## datafusion/sql/src/expr/function.rs: ########## @@ -336,7 +369,28 @@ impl<S: ContextProvider> SqlToRel<'_, S> { None, )?; let order_by = (!order_by.is_empty()).then_some(order_by); - let args = self.function_args_to_expr(args, schema, planner_context)?; + let mut args = + self.function_args_to_expr(args, schema, planner_context)?; + + let within_group = self.order_by_to_sort_expr( + within_group, + schema, + planner_context, + false, + None, + )?; + + // add target column expression in within group clause to function arguments Review Comment: The `Signature` of `ApproxPercentileCont` and `ApproxPercentileContWithWeight` are not changed. Instead, the expression in `WITHIN GROUP` clause is added into function arguments while converting `sql expr` to `logical expr`. -- 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