This is an automated email from the ASF dual-hosted git repository.
englefly pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new cd5f9d7ce79 [fix](nereids)reserve stats and groupId on rewriting plan
node (#42140)
cd5f9d7ce79 is described below
commit cd5f9d7ce79f26f09136db0010137b5c882bc276
Author: minghong <[email protected]>
AuthorDate: Tue Oct 22 21:22:43 2024 +0800
[fix](nereids)reserve stats and groupId on rewriting plan node (#42140)
## Proposed changes
when node is rewriten, stats and group Id is removed
this pr try to keep them
Issue Number: close #xxx
<!--Describe your changes.-->
---
.../nereids/trees/plans/visitor/DefaultPlanRewriter.java | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
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 ff89572197d..3a30191d2c0 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,15 @@ public abstract class DefaultPlanRewriter<C> extends
PlanVisitor<Plan, C> {
}
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;
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]