make AnalysisContext aware of empty sets to represent certainly false bounds#14279
Merged
berkaysynnada merged 7 commits intoapache:mainfrom Jan 28, 2025
Merged
Conversation
ozankabak
reviewed
Jan 25, 2025
Contributor
ozankabak
left a comment
There was a problem hiding this comment.
Thank you for taking this issue @buraksenn - left some feedback for minor improvements
Co-authored-by: Mehmet Ozan Kabak <[email protected]>
Contributor
|
Thank you @buraksenn. I've just sent a minor commit. If you've done with this PR, I am merging it once the CI is green again. |
berkaysynnada
approved these changes
Jan 28, 2025
Contributor
berkaysynnada
left a comment
There was a problem hiding this comment.
This looks good now. I'm merging it, and if someone comes up with another idea, then we can create a ticket.
andygrove
reviewed
Jan 31, 2025
| /// For example, if the column `a` has values in the range [10, 20], | ||
| /// and there is a filter asserting that `a > 50`, then the resulting interval | ||
| /// range of `a` will be `None`. | ||
| pub interval: Option<Interval>, |
Member
There was a problem hiding this comment.
I added the api-change label due to making interval an Option.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Closes #14226
Rationale for this change
Details from #14226:
The
AnalysisContextwhich is the result of theanalyzemethod for refining column boundaries from a physical expression represents an empty set the same as an unbounded set.For example, in the case where the bounds can not be shrunk, e.g., a < 0 OR a >= 0, this results an interval of [None, None], but means [-∞, ∞], i.e., CERTAINLY_TRUE. In the case where the bounds represent an empty set, e.g., a < 0 AND a > 0, this also results in an interval of [None, None], but should mean CERTAINLY_FALSE.
What changes are included in this PR?
Are these changes tested?
Added unit tests. Also existing tests is to be passed before merging this one
Are there any user-facing changes?
I think this breaks public API but I could not find any other way to do this without it.