avantgardnerio commented on code in PR #7192:
URL: https://github.com/apache/arrow-datafusion/pull/7192#discussion_r1301886281
##########
datafusion/core/src/physical_plan/aggregates/mod.rs:
##########
@@ -265,6 +270,8 @@ pub struct AggregateExec {
pub(crate) filter_expr: Vec<Option<Arc<dyn PhysicalExpr>>>,
/// (ORDER BY clause) expression for each aggregate expression
pub(crate) order_by_expr: Vec<Option<LexOrdering>>,
+ /// Set if the output of this aggregation is truncated by a upstream
sort/limit clause
+ pub(crate) limit: Option<usize>,
Review Comment:
> this might look like a fetch on sort or limit
I think that's pretty fair actually, and `fetch` might be a good name.
> perhaps it only marks limit for the right combinations
Exactly, when the optimizer finds a `fetch/limit` that can be pushed down
from the `SortExec` to the `AggregateExec` it sets this field. It will only set
it if the aggregate function matches the sort direction (i.e. `desc` w /
`MAX()`)
--
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]