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


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/PlanContext.java:
##########
@@ -103,4 +109,34 @@ public StatsDeriveResult getChildStatistics(int index) {
         Preconditions.checkNotNull(statistics);
         return statistics;
     }
+
+    @Override
+    public StatsDeriveResult getStatsDeriveResult() {
+        if (groupExpression != null) {
+            return groupExpression.getParent().getStatistics();
+        }
+        return plan.getStats();
+    }
+
+    @Override
+    public void setStatsDeriveResult(StatsDeriveResult result) {
+        if (groupExpression != null) {
+            groupExpression.getParent().setStatistics(result);
+            groupExpression.setStatDerived(true);
+        }
+        plan.setStats(result);

Review Comment:
   ```suggestion
           } else {
               plan.setStats(result);
           }
   ```



##########
fe/fe-core/src/main/java/org/apache/doris/nereids/PlanContext.java:
##########
@@ -36,7 +42,7 @@
  * A ExpressionHandle is attached to either {@link Plan} or {@link 
GroupExpression}.
  * Inspired by GPORCA-CExpressionHandle.
  */
-public class PlanContext {
+public class PlanContext implements PlanStats {

Review Comment:
   maybe we need remove PlanContext and let GroupExpression implements PlanStats



-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to