Merged
Conversation
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Contributor
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
If a new flag is being introduced:
If a workflow is added or modified:
Bug fixes
Non-trivial changes
New/Existing features
Backward compatibility
|
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
3d68b6e to
5a9b638
Compare
Comment on lines
+56
to
+60
| // BottomUp rewrites an operator tree from the bottom up. BottomUp applies a transformation function to | ||
| // the given operator tree from the bottom up. Each callback [f] returns a TreeIdentity that is aggregated | ||
| // into a final output indicating whether the operator tree was changed. | ||
| func BottomUp(root ops.Operator, f Func) (ops.Operator, error) { | ||
| op, _, err := bottomUp(root, f) |
Member
There was a problem hiding this comment.
looks like the comment should actually move to bottomUp function where the logic resides.
Collaborator
Author
There was a problem hiding this comment.
nah, the comment belongs here. the internal bottomUp does the actual work, but the description belongs here, I think.
Comment on lines
+67
to
+72
| // TopDown applies a transformation function to the given operator tree from the bottom up. = | ||
| // Each callback [f] returns a TreeIdentity that is aggregated into a final output indicating whether the | ||
| // operator tree was changed. | ||
| // The callback also returns a VisitRule that signals whether the children of this operator should be visited or not | ||
| func TopDown(in ops.Operator, rewriter BreakableFunc) (ops.Operator, error) { | ||
| op, _, err := breakableTopDown(in, rewriter) |
harshit-gangal
approved these changes
Nov 11, 2022
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
This is part of my ongoing refactoring of the planner operators in Vitess.
In this PR we handle horizon planning for the simplest cases (single sharded route plans) on the operators instead of using the logical plan version of horizon planning.
I'm also changing the rewriter to be easier to read - instead of true and false everywhere, I use named constants -
rewrite.NewTreeandrewrite.SkipChildrenare easier to read and understand than literal booleans.Related Issue(s)
#11626