-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
HIVE-27102: Upgrade Calcite to 1.33.0 and Avatica to 1.23.0 #5196
base: master
Are you sure you want to change the base?
HIVE-27102: Upgrade Calcite to 1.33.0 and Avatica to 1.23.0 #5196
Conversation
This was failing because during logical planning key*1 is getting reduced to key in 1.33, whereas it was not reduced in 1.25. Changing it to key*2 will stop the reduction.
`NOT(SEARCH(...))` is simplified to `SEARCH[(..), (...)]` in RexSimplify# simplifyNot Removed testComputeRangePredicateSelectivityNotBetweenRightLowerThanLeft as it is not possible to create a RexNode with right < left
tries. This can be removed after upgrading to Calcite 1.38 https://issues.apache.org/jira/browse/CALCITE-6453
298d298
to
47cf072
Compare
private static RexNode simplify(RexSimplify simplifier, RexNode node) { | ||
RexNode result = node; | ||
int maxTries = 5; | ||
for (int i = 0; i < maxTries; i++) { | ||
RexNode simplified = simplifier.simplify(result); | ||
if (simplified.equals(result)) { | ||
break; | ||
} | ||
result = simplified; | ||
} | ||
|
||
return result; |
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.
This part indicates that there is some part of flakiness/nondeterminism in the mix. Moreover, the simplifier is rather costly so calling it multiple times can have an impact on performance. Why do we need to do this? What is the expression that requires multiple rounds of simplification? This probably deserves logging a dedicated CALCITE ticket. Unfortunately this cannot be committed as such we need to work out a solution.
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.
Yes, this is rather crude, and I will remove it. I just wanted to test that if the RexNode is completely simplified at this point, then we won't run into the infinite for loop issue - this is explained by Krisztian here.
There is already a ticket in Calcite to fix this: CALCITE-6453.
So the issue is really with certain CASTs not getting reduced, and we have to call simplify twice to reduce it.
… a max of 5" This reverts commit 9724d26.
Quality Gate passedIssues Measures |
What changes were proposed in this pull request?
Upgrade Calcite to 1.33, Avatica to 1.23
Why are the changes needed?
Does this PR introduce any user-facing change?
Logical explain plans can have SEARCH operators instead of BETWEENs and INs
Is the change a dependency upgrade?
Yes
How was this patch tested?
With Ptests