Skip to content

Commit

Permalink
updated variable names to be more descriptive
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewgapp committed Sep 21, 2023
1 parent 9527ed0 commit 86db8cf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion datafusion/core/src/physical_optimizer/coalesce_batches.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,9 @@ impl CoalesceContext {
/// Creates a new context for a descendent of this context.
/// The descendent will inherit the `has_recursive_ancestor` flag from this context.
fn new_descendent(&self, descendent_plan: Arc<dyn ExecutionPlan>) -> Self {
let ancestor = self;
Self {
has_recursive_ancestor: self.has_recursive_ancestor
has_recursive_ancestor: ancestor.has_recursive_ancestor
|| is_recursive_query(&descendent_plan),
plan: descendent_plan,
}
Expand Down
12 changes: 8 additions & 4 deletions datafusion/core/src/physical_optimizer/enforce_distribution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1467,16 +1467,20 @@ impl DistributionContext {
/// Creates a new context from a descendent plan.
/// Importantly, this function propagates the `has_recursive_ancestor` flag.
fn new_descendent(&self, descendent_plan: Arc<dyn ExecutionPlan>) -> Self {
let mut ctx = Self::new(descendent_plan);
ctx.has_recursive_ancestor |= self.has_recursive_ancestor;
ctx
let ancestor = self;

let mut new_ctx = Self::new(descendent_plan);
new_ctx.has_recursive_ancestor |= ancestor.has_recursive_ancestor;
new_ctx
}

/// Creates a new context from a descendent context.
/// Importantly, this function propagates the `has_recursive_ancestor` flag.
fn new_descendent_from_ctx(&self, ctx: Self) -> Self {
let ancestor = self;

let mut ctx = ctx;
ctx.has_recursive_ancestor |= self.has_recursive_ancestor;
ctx.has_recursive_ancestor |= ancestor.has_recursive_ancestor;
ctx
}

Expand Down

0 comments on commit 86db8cf

Please sign in to comment.