Skip to content

Commit

Permalink
pick
Browse files Browse the repository at this point in the history
  • Loading branch information
englefly committed Oct 25, 2024
1 parent 90ddbb4 commit 39210d1
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package org.apache.doris.nereids.trees.plans.visitor;

import org.apache.doris.nereids.trees.plans.Plan;
import org.apache.doris.nereids.trees.plans.physical.AbstractPhysicalPlan;
import org.apache.doris.nereids.trees.plans.physical.PhysicalOlapScan;
import org.apache.doris.nereids.trees.plans.physical.PhysicalStorageLayerAggregate;

Expand Down Expand Up @@ -56,6 +57,14 @@ public static <P extends Plan, C> P visitChildren(DefaultPlanRewriter<C> rewrite
}
newChildren.add(newChild);
}
return hasNewChildren ? (P) plan.withChildren(newChildren.build()) : plan;
if (hasNewChildren) {
plan = (P) plan.withChildren(newChildren.build());
if (plan instanceof AbstractPhysicalPlan) {
AbstractPhysicalPlan physicalPlan = (AbstractPhysicalPlan) plan;
plan = (P) ((AbstractPhysicalPlan) physicalPlan.withChildren(newChildren.build()))
.copyStatsAndGroupIdFrom(physicalPlan);
}
}
return plan;
}
}

0 comments on commit 39210d1

Please sign in to comment.