Skip to content
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

Open
wants to merge 83 commits into
base: master
Choose a base branch
from

Conversation

soumyakanti3578
Copy link
Contributor

@soumyakanti3578 soumyakanti3578 commented Apr 15, 2024

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

Comment on lines 691 to 702
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;
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link

sonarcloud bot commented Jul 25, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants