-
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
Minor: remove confusing update_plan_from_children
call from EnforceSorting
#14650
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,6 +42,8 @@ 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 | ||
/// to perform mutable operations via [`Self::update_plan_from_children`]. | ||
/// After update `children`, please do the sync updating for `plan`'s 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. I wonder if we could find some way to avoid having to remember to do this 🤔 If we have to remember to call a function it seems likely either our future selves or others will forget to do so 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. Maybe one way would be to make these fields not so like add a method so the only way to update children woudl be impl PlanContext {
fn update_children(&mut self, new_children: Vec<Self>) -> {
self.children = new_children;
self.update_child_data()
} 🤔 To be clear I am talking about some future PR 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. Yes, I've tried this way to make the operation "atomic", but I found it hard to change, most places acquire I have another way to avoid the mind burden. Currrently, we have two parallel tree structures:
I'm trying to make them single. |
||
/// Or after creating the `PlanContext`, if you can't guarantee they are consistent, call `update_plan_from_children` to sync. | ||
#[derive(Debug)] | ||
pub struct PlanContext<T: Sized> { | ||
/// The execution plan associated with this context. | ||
|
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.
I found the methods names hard to follow -- for example
update_children_data
actually has aOrderPreservationContext
🤔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, I changed to
update_order_preservation_ctx_children_data
, longer but clearer