You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/07/14 13:33:37 UTC

[GitHub] [doris] morrySnow commented on a diff in pull request #10839: [feature](nereids) Integrate existing stats framework to nereids

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-unsubscribe@doris.apache.org

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


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