Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix](nereids)reserve stats and groupId on rewriting plan node #42140

Merged
merged 2 commits into from
Oct 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,15 @@ 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;
}
}
Loading