-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Improve EnforceSorting docs. #14673
Merged
alamb
merged 7 commits into
apache:main
from
influxdata:wiedld/update-enforce-sorting-docs
Feb 16, 2025
Merged
Improve EnforceSorting docs. #14673
Changes from 2 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
0ec6f34
chore: add documentation for EnforceSorting
wiedld e2f5218
chore: doc temporary TODO for xudong963's PR
wiedld 6bf54ae
chore: remove unneeded reference to other PR
wiedld 2aac2bf
chore: fix docs to appropriately refer to subrules
wiedld 2754300
chore: fix typos
wiedld 0770fd3
Merge branch 'main' into wiedld/update-enforce-sorting-docs
wiedld 2b24136
chore: cleanup docs after merge from main
wiedld File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,8 +39,14 @@ impl DynTreeNode for dyn ExecutionPlan { | |
} | ||
} | ||
|
||
/// A node object beneficial for writing optimizer rules, encapsulating an [`ExecutionPlan`] node with a payload. | ||
/// Since there are two ways to access child plans—directly from the plan and through child nodes—it's recommended | ||
/// A node context object beneficial for writing optimizer rules. | ||
/// This context encapsulating an [`ExecutionPlan`] node with a payload. | ||
/// | ||
/// Since each wrapped node has it's children within both the [`PlanContext.plan.children()`], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 this is indeed quite subtle -- it would be awesome if we could find some way to make it harder to forget to call |
||
/// as well as separately within the [`PlanContext.children`] (which are child nodes wrapped in the context), | ||
/// it's important to keep these child plans in sync when performing mutations. | ||
/// | ||
/// Since there are two ways to access child plans—directly -— it's recommended | ||
/// to perform mutable operations via [`Self::update_plan_from_children`]. | ||
#[derive(Debug)] | ||
pub struct PlanContext<T: Sized> { | ||
|
@@ -61,6 +67,8 @@ impl<T> PlanContext<T> { | |
} | ||
} | ||
|
||
/// Update the [`PlanContext.plan.children()`] from the [`PlanContext.children`], | ||
/// if the `PlanContext.children` have been changed. | ||
pub fn update_plan_from_children(mut self) -> Result<Self> { | ||
let children_plans = self.children.iter().map(|c| Arc::clone(&c.plan)).collect(); | ||
self.plan = with_new_children_if_necessary(self.plan, children_plans)?; | ||
|
Oops, something went wrong.
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.
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.
💯