[CALCITE-2421] Improve RexSimplify when unknownAsFalse is true#765
Open
laurentgo wants to merge 1 commit intoapache:mainfrom
Open
[CALCITE-2421] Improve RexSimplify when unknownAsFalse is true#765laurentgo wants to merge 1 commit intoapache:mainfrom
laurentgo wants to merge 1 commit intoapache:mainfrom
Conversation
When simplifying AND expression with unknownAsFalse set to true, simplification of some terms might be under-optimal as unknownAsFalse value is not propagated through but set to false. Expressions like A <= A AND B => B might stay as-is whereas they could be simplified as A IS NOT NULL AND B IS NOT NULL Improve the simplification of those comparison expressions when unknownAsFalse is true by keeping flag as-is while processing terms in simplifyAndTerms.
08e2301 to
ed14129
Compare
vlsi
requested changes
Jan 8, 2019
|
|
||
| private void simplifyAndTerms(List<RexNode> terms) { | ||
| RexSimplify simplify = withUnknownAsFalse(false); | ||
| RexSimplify simplify = this; |
Contributor
There was a problem hiding this comment.
This change was already implemented in 6b3844c, however the test fails.
@laurentgo , could you please rebase?
Contributor
Author
There was a problem hiding this comment.
Yes, looks like already fixed. Should I still work on adding the test cases?
80f411d to
ca27fe9
Compare
49cb002 to
8768a23
Compare
8a5cf83 to
cf7f71b
Compare
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.
Improve simplification of expression by RexSimplify when unknownAsFalse
is true by not setting back unknownAsFalse to false while processing
terms.
Allow for expressions like A = A AND B = B to be simplified as
A IS NOT NULL AND B IS NOT NULL