cherry pick from #48934
This commit is contained in:
@ -1066,6 +1066,21 @@ public class PhysicalPlanTranslator extends DefaultPlanVisitor<PlanFragment, Pla
|
||||
// Set colocate info in agg node. This is a hint for local shuffling to decide which type of
|
||||
// local exchanger will be used.
|
||||
aggregationNode.setColocate(true);
|
||||
|
||||
Plan child = aggregate.child();
|
||||
// we should set colocate = true, when the same LogicalAggregate generate two PhysicalHashAggregates
|
||||
// in one fragment:
|
||||
//
|
||||
// agg(merge finalize) <- current, set colocate = true
|
||||
// |
|
||||
// agg(update serialize) <- child, also set colocate = true
|
||||
if (aggregate.getAggregateParam().aggMode.consumeAggregateBuffer
|
||||
&& child instanceof PhysicalHashAggregate
|
||||
&& !((PhysicalHashAggregate<Plan>) child).getAggregateParam().aggMode.consumeAggregateBuffer
|
||||
&& inputPlanFragment.getPlanRoot() instanceof AggregationNode) {
|
||||
AggregationNode childAgg = (AggregationNode) inputPlanFragment.getPlanRoot();
|
||||
childAgg.setColocate(true);
|
||||
}
|
||||
}
|
||||
setPlanRoot(inputPlanFragment, aggregationNode, aggregate);
|
||||
if (aggregate.getStats() != null) {
|
||||
|
||||
Reference in New Issue
Block a user