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/05/31 01:55:31 UTC

[GitHub] [incubator-doris] morrySnow commented on a diff in pull request #9807: [Enhancement](Nereids)rewrite framework used in Memo

morrySnow commented on code in PR #9807:
URL: https://github.com/apache/incubator-doris/pull/9807#discussion_r885144758


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/memo/GroupExpression.java:
##########
@@ -17,42 +17,47 @@
 
 package org.apache.doris.nereids.memo;
 
+import org.apache.doris.nereids.operators.Operator;
 import org.apache.doris.nereids.rules.Rule;
 import org.apache.doris.nereids.rules.RuleType;
-import org.apache.doris.nereids.trees.plans.Plan;
 
 import com.clearspring.analytics.util.Lists;
 
 import java.util.BitSet;
 import java.util.List;
+import java.util.Objects;
 
 /**
  * Representation for group expression in cascades optimizer.
  */
 public class GroupExpression {
     private Group parent;
     private List<Group> children;
-    private final Plan<?, ?> plan;
+    private final Operator op;
     private final BitSet ruleMasks;
     private boolean statDerived;
 
-    public GroupExpression(Plan<?, ?> plan) {
-        this(plan, Lists.newArrayList());
+    public GroupExpression(Operator op) {
+        this(op, Lists.newArrayList());
     }
 
     /**
      * Constructor for GroupExpression.
      *
-     * @param plan {@link Plan} to reference
+     * @param op {@link Operator} to reference
      * @param children children groups in memo
      */
-    public GroupExpression(Plan<?, ?> plan, List<Group> children) {
-        this.plan = plan;
-        this.children = children;
+    public GroupExpression(Operator op, List<Group> children) {
+        this.op = Objects.requireNonNull(op);
+        this.children = Objects.requireNonNull(children);
         this.ruleMasks = new BitSet(RuleType.SENTINEL.ordinal());
         this.statDerived = false;
     }
 
+    public int arity() {

Review Comment:
   In logic, mathematics, and computer science, the arity of a function or operation is the number of arguments or operands the function or operation accepts.



-- 
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