Skip to content

Commit

Permalink
fix missing stats
Browse files Browse the repository at this point in the history
  • Loading branch information
englefly committed Sep 12, 2023
1 parent 0b3e5de commit b0e0156
Showing 1 changed file with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import org.apache.doris.nereids.CascadesContext;
import org.apache.doris.nereids.properties.PhysicalProperties;
import org.apache.doris.nereids.trees.plans.AbstractPlan;
import org.apache.doris.nereids.trees.plans.Plan;
import org.apache.doris.nereids.trees.plans.physical.PhysicalFilter;
import org.apache.doris.nereids.trees.plans.physical.PhysicalPlan;
Expand All @@ -37,10 +38,14 @@ public Plan visitPhysicalFilter(PhysicalFilter<? extends Plan> filter, CascadesC
Plan child = filter.child();
if (!(child instanceof PhysicalProject)) {
PhysicalPlan newChild = (PhysicalPlan) child.accept(this, context);
newChild = newChild.withPhysicalPropertiesAndStats(properties, stats);
PhysicalPlan ret = ((PhysicalPlan)(filter.withChildren(newChild)))
.withPhysicalPropertiesAndStats(properties, stats);
return ret;
if (child != newChild) {
newChild = newChild.withPhysicalPropertiesAndStats(
((PhysicalPlan)child).getPhysicalProperties(),
((AbstractPlan)child).getStats());
return ((PhysicalPlan) (filter.withChildren(newChild)))
.withPhysicalPropertiesAndStats(properties, stats);
}
return filter;
}

PhysicalProject<? extends Plan> project = (PhysicalProject<? extends Plan>) child;
Expand All @@ -51,6 +56,6 @@ public Plan visitPhysicalFilter(PhysicalFilter<? extends Plan> filter, CascadesC
newChild = newChild.withPhysicalPropertiesAndStats(properties, stats);
PhysicalPlan ret = ((PhysicalPlan) (project.withChildren(newChild)))
.withPhysicalPropertiesAndStats(properties, stats);
return ret ;
return ret;
}
}

0 comments on commit b0e0156

Please sign in to comment.