morrySnow commented on code in PR #12790:
URL: https://github.com/apache/doris/pull/12790#discussion_r977153526


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/NereidsPlanner.java:
##########
@@ -190,11 +191,14 @@ private PhysicalPlan chooseBestPlan(Group rootGroup, 
PhysicalProperties physical
 
         Plan plan = groupExpression.getPlan().withChildren(planChildren);
         if (!(plan instanceof PhysicalPlan)) {
-            throw new AnalysisException("generate logical plan");
+            throw new AnalysisException("Result plan must be PhysicalPlan");
         }
 
         // TODO: set (logical and physical)properties/statistics/... for 
physicalPlan.
-        return ((PhysicalPlan) 
plan).withPhysicalProperties(groupExpression.getOutputProperties(physicalProperties));
+        PhysicalPlan physicalPlan = ((PhysicalPlan) 
plan).withPhysicalProperties(
+                groupExpression.getOutputProperties(physicalProperties));
+        ((AbstractPlan) 
physicalPlan).setStats(groupExpression.getOwnerGroup().getStatistics());

Review Comment:
   change withPhyscialProperties to withPhyscialPropertiesAndStats, and remove 
setStats function. We need to do our best to ensure immutable



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to