-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: Monotonic Sets #14271
base: main
Are you sure you want to change the base?
Feature: Monotonic Sets #14271
Conversation
# Conflicts: # datafusion/core/src/physical_optimizer/enforce_sorting.rs # datafusion/core/src/physical_optimizer/test_utils.rs
# Conflicts: # datafusion/core/src/physical_optimizer/enforce_sorting.rs # datafusion/physical-optimizer/src/test_utils.rs
separate stubs and count_udafs
change monotonicity to return an Enum rather than Option<bool> fix indices re-add monotonicity tests
# Conflicts: # datafusion/core/tests/physical_optimizer/enforce_sorting.rs
@@ -4963,6 +4963,9 @@ false | |||
true | |||
NULL | |||
|
|||
statement ok |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are related with #14231
/// function is monotonically increasing if its value increases as its argument grows | ||
/// (as a set). Formally, `f` is a monotonically increasing set function if `f(S) >= f(T)` | ||
/// whenever `S` is a superset of `T`. | ||
fn monotonicity(&self, _data_type: &DataType) -> AggregateExprMonotonicity { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I recommend adding a note at the beginning of the comment: This is used for a specific (is it BoundedWindowAggExec? )optimization and can be skipped by using the default implementation.
This interface seems quite difficult to understand for a general user who only wants to add a simple UDAF
Which issue does this PR close?
Closes #.
Rationale for this change
This PR creates a definition of set-monotonicity for Aggregate expressions. Some aggregation functions create ordered results by definition (such as count, min, max). With this PR, we're adding this information to the output ordering and be able to remove some SortExecs while optimizing
What changes are included in this PR?
Are these changes tested?
Are there any user-facing changes?