ozankabak commented on PR #14271: URL: https://github.com/apache/datafusion/pull/14271#issuecomment-2623728047
Thanks for reviewing carefully, as always, much appreciated 🚀 > ```select a, agg(b) FROM ... GROUP BY a ORDER BY a, agg(b)``` You are right that all queries of this form can be optimized independent of what `agg` is. The unit tests involving such queries in this PR should work even in the absence of the `AggregateExprSetMonotonicity` concept. The main intent behind `AggregateExprSetMonotonicity` is the following: 1. To make windowing queries ordering aware in case of set-monotonic window/aggregation functions. This is the immediate benefit, and you can find the tests exercising this in `window.slt`. 2. To open the door to incremental computations involving filters containing comparisons between an accumulated value (e.g. a `COUNT`) and a fixed value (or a value with a bound). In such cases, you can do efficient calculations/pruning only when you have set-monotonicity information on the aggregate function computing the accumulated value. We plan to bring such functionality to DataFusion in the upcoming months. Does that help? -- 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