alamb commented on code in PR #18831:
URL: https://github.com/apache/datafusion/pull/18831#discussion_r2554113695
##########
datafusion/sql/src/select.rs:
##########
@@ -872,16 +887,25 @@ impl<S: ContextProvider> SqlToRel<'_, S> {
/// the aggregate
/// * `qualify_expr_post_aggr` - The "qualify" expression rewritten to
reference a column from
/// the aggregate
- #[allow(clippy::type_complexity)]
+ /// * `order_by_post_aggr` - The ORDER BY expressions rewritten to
reference columns from
+ /// the aggregate
+ #[allow(clippy::type_complexity, clippy::too_many_arguments)]
fn aggregate(
&self,
input: &LogicalPlan,
select_exprs: &[Expr],
having_expr_opt: Option<&Expr>,
qualify_expr_opt: Option<&Expr>,
+ order_by_exprs: &[SortExpr],
group_by_exprs: &[Expr],
aggr_exprs: &[Expr],
- ) -> Result<(LogicalPlan, Vec<Expr>, Option<Expr>, Option<Expr>)> {
+ ) -> Result<(
Review Comment:
maybe as a follow on it would be nice to return a structure with named
fields instead of this giant tuple
##########
datafusion/sql/src/select.rs:
##########
@@ -872,16 +887,25 @@ impl<S: ContextProvider> SqlToRel<'_, S> {
/// the aggregate
/// * `qualify_expr_post_aggr` - The "qualify" expression rewritten to
reference a column from
/// the aggregate
- #[allow(clippy::type_complexity)]
+ /// * `order_by_post_aggr` - The ORDER BY expressions rewritten to
reference columns from
+ /// the aggregate
+ #[allow(clippy::type_complexity, clippy::too_many_arguments)]
fn aggregate(
&self,
input: &LogicalPlan,
select_exprs: &[Expr],
having_expr_opt: Option<&Expr>,
qualify_expr_opt: Option<&Expr>,
+ order_by_exprs: &[SortExpr],
group_by_exprs: &[Expr],
aggr_exprs: &[Expr],
- ) -> Result<(LogicalPlan, Vec<Expr>, Option<Expr>, Option<Expr>)> {
+ ) -> Result<(
Review Comment:
Something like
```rust
struct AggregatePlan {
/// A [LogicalPlan::Aggregate] plan for the newly created aggregate.
plan: LogicalPlan,
/// The projection expressions rewritten to reference columns from the
aggregate
select_exprs_post_aggr: &[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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]