File tree 2 files changed +10
-5
lines changed
datafusion/core/src/physical_optimizer
2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -67,8 +67,9 @@ impl CoalesceContext {
67
67
/// Creates a new context for a descendent of this context.
68
68
/// The descendent will inherit the `has_recursive_ancestor` flag from this context.
69
69
fn new_descendent ( & self , descendent_plan : Arc < dyn ExecutionPlan > ) -> Self {
70
+ let ancestor = self ;
70
71
Self {
71
- has_recursive_ancestor : self . has_recursive_ancestor
72
+ has_recursive_ancestor : ancestor . has_recursive_ancestor
72
73
|| is_recursive_query ( & descendent_plan) ,
73
74
plan : descendent_plan,
74
75
}
Original file line number Diff line number Diff line change @@ -1467,16 +1467,20 @@ impl DistributionContext {
1467
1467
/// Creates a new context from a descendent plan.
1468
1468
/// Importantly, this function propagates the `has_recursive_ancestor` flag.
1469
1469
fn new_descendent ( & self , descendent_plan : Arc < dyn ExecutionPlan > ) -> Self {
1470
- let mut ctx = Self :: new ( descendent_plan) ;
1471
- ctx. has_recursive_ancestor |= self . has_recursive_ancestor ;
1472
- ctx
1470
+ let ancestor = self ;
1471
+
1472
+ let mut new_ctx = Self :: new ( descendent_plan) ;
1473
+ new_ctx. has_recursive_ancestor |= ancestor. has_recursive_ancestor ;
1474
+ new_ctx
1473
1475
}
1474
1476
1475
1477
/// Creates a new context from a descendent context.
1476
1478
/// Importantly, this function propagates the `has_recursive_ancestor` flag.
1477
1479
fn new_descendent_from_ctx ( & self , ctx : Self ) -> Self {
1480
+ let ancestor = self ;
1481
+
1478
1482
let mut ctx = ctx;
1479
- ctx. has_recursive_ancestor |= self . has_recursive_ancestor ;
1483
+ ctx. has_recursive_ancestor |= ancestor . has_recursive_ancestor ;
1480
1484
ctx
1481
1485
}
1482
1486
You can’t perform that action at this time.
0 commit comments