Fix logging of plan optimizer#21226
Merged
feilong-liu merged 1 commit intoprestodb:masterfrom Oct 26, 2023
Merged
Conversation
2542e12 to
2e67c57
Compare
Contributor
|
Thanks for fixing these! |
mlyublena
reviewed
Oct 24, 2023
...src/main/java/com/facebook/presto/sql/planner/optimizations/RandomizeNullKeyInOuterJoin.java
Outdated
Show resolved
Hide resolved
mlyublena
reviewed
Oct 24, 2023
Contributor
There was a problem hiding this comment.
are we sure that this optimizer added the exchange node and it wasn't there before?
Contributor
Author
There was a problem hiding this comment.
Yes, we only have this optimizer to add remote exchange node.
mlyublena
approved these changes
Oct 24, 2023
feilong-liu
commented
Oct 24, 2023
Contributor
Author
There was a problem hiding this comment.
Instead of comparing plan node, now the optimizer returns whether the plan is changed or not.
Change the result type of PlanOptimizer, so that it not only returns the new plan node, but also returns whether the optimizer is triggered or not.
pranjalssh
approved these changes
Oct 25, 2023
26 tasks
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.
Description
Change the result type of PlanOptimizer, so that it not only returns the new plan node, but also returns whether the optimizer is triggered or not.
Motivation and Context
Currently, the logging of PlanOptimizer is to compare the old and new plan root with the equal operator. However, this leads to false positives, where any non meaningful changes (for example reorder of outputs etc) will show as optimizer triggered. It also relies on proper equal() override for all data structures in query plans.
In this PR, I change the PlanOptimizer to explicitly return whether an optimizer is triggered or not. I've implemented them for all existing plan optimizers.
Impact
Fix logging of optimizers, and eliminate false positives.
Test Plan
Existing unit tests.
Contributor checklist
Release Notes
Please follow release notes guidelines and fill in the release notes below.