diff --git a/fe/.idea/vcs.xml b/fe/.idea/vcs.xml
index 7b2cdb1cbbd39ab..8c0f59e92e6c5bd 100644
--- a/fe/.idea/vcs.xml
+++ b/fe/.idea/vcs.xml
@@ -1,20 +1,4 @@
-
-
+
+
+
-
+
\ No newline at end of file
diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/visitor/DefaultPlanRewriter.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/visitor/DefaultPlanRewriter.java
index ff89572197df0bd..c3d29372a1e8783 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/visitor/DefaultPlanRewriter.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/visitor/DefaultPlanRewriter.java
@@ -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;
@@ -56,6 +57,14 @@ public static
P visitChildren(DefaultPlanRewriter 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;
}
}