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/06/16 03:28:41 UTC

[GitHub] [incubator-doris] 924060929 opened a new pull request, #10176: [Enhancement](Nereids) Automatic compute logical properties

924060929 opened a new pull request, #10176:
URL: https://github.com/apache/incubator-doris/pull/10176

   # Proposed changes
   
   Issue Number: no issue
   
   ## Problem Summary:
   
   Automatic compute logical properties
   
   ## Checklist(Required)
   
   1. Does it affect the original behavior: No
   2. Has unit tests been added: Yes
   3. Has document been added or modified: No Need
   4. Does it need to update dependencies: No
   5. Are there any changes that cannot be rolled back: No
   


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


[GitHub] [incubator-doris] morrySnow commented on a diff in pull request #10176: [Enhancement](Nereids) Automatic compute logical properties

Posted by GitBox <gi...@apache.org>.
morrySnow commented on code in PR #10176:
URL: https://github.com/apache/incubator-doris/pull/10176#discussion_r898720480


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalBinaryPlan.java:
##########
@@ -39,18 +41,29 @@
         implements BinaryPlan<LEFT_CHILD_TYPE, RIGHT_CHILD_TYPE> {
 
     public LogicalBinaryPlan(OP_TYPE operator, LEFT_CHILD_TYPE leftChild, RIGHT_CHILD_TYPE rightChild) {
-        super(NodeType.LOGICAL, operator, leftChild, rightChild);
+        super(NodeType.LOGICAL, operator, Optional.empty(), leftChild, rightChild);
     }
 
-    public LogicalBinaryPlan(OP_TYPE operator, GroupExpression groupExpression, LogicalProperties logicalProperties,
-            LEFT_CHILD_TYPE leftChild, RIGHT_CHILD_TYPE rightChild) {
+    public LogicalBinaryPlan(OP_TYPE operator, Optional<LogicalProperties> logicalProperties,
+                             LEFT_CHILD_TYPE leftChild, RIGHT_CHILD_TYPE rightChild) {
+        super(NodeType.LOGICAL, operator, logicalProperties, leftChild, rightChild);
+    }
+
+    public LogicalBinaryPlan(OP_TYPE operator, Optional<GroupExpression> groupExpression,
+             Optional<LogicalProperties> logicalProperties, LEFT_CHILD_TYPE leftChild, RIGHT_CHILD_TYPE rightChild) {
         super(NodeType.LOGICAL, operator, groupExpression, logicalProperties, leftChild, rightChild);
     }
 
     @Override
-    public LogicalBinaryPlan<OP_TYPE, Plan, Plan> newChildren(List<Plan> children) {
+    public LogicalBinaryPlan<OP_TYPE, Plan, Plan> withChildren(List<Plan> children) {
         Preconditions.checkArgument(children.size() == 2);
-        return new LogicalBinaryPlan(operator, groupExpression.orElse(null),
-                logicalProperties, children.get(0), children.get(1));
+        return new LogicalBinaryPlan(operator, groupExpression, Optional.empty(),
+            children.get(0), children.get(1));
+    }
+
+    @Override
+    public LogicalBinaryPlan<OP_TYPE, LEFT_CHILD_TYPE, RIGHT_CHILD_TYPE> withOutput(List<Slot> output) {
+        LogicalProperties logicalProperties = new LogicalProperties(output);

Review Comment:
   maybe we need a function like withOutput for LogicalProperties



##########
fe/fe-core/src/main/java/org/apache/doris/nereids/operators/plans/logical/LogicalOperator.java:
##########
@@ -27,5 +27,5 @@
  * interface for all concrete logical plan operator.
  */
 public interface LogicalOperator extends PlanOperator {
-    List<Slot> computeOutput(Plan... inputs);
+    List<Slot> computeOutput(List<Plan> inputs);

Review Comment:
   could it better to replace `computeOutput` with `computeLogicalProperties`?



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


[GitHub] [incubator-doris] 924060929 commented on a diff in pull request #10176: [Enhancement](Nereids) Automatic compute logical properties

Posted by GitBox <gi...@apache.org>.
924060929 commented on code in PR #10176:
URL: https://github.com/apache/incubator-doris/pull/10176#discussion_r898822560


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/operators/plans/logical/LogicalOperator.java:
##########
@@ -27,5 +27,5 @@
  * interface for all concrete logical plan operator.
  */
 public interface LogicalOperator extends PlanOperator {
-    List<Slot> computeOutput(Plan... inputs);
+    List<Slot> computeOutput(List<Plan> inputs);

Review Comment:
   done



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


[GitHub] [incubator-doris] morrySnow commented on a diff in pull request #10176: [Enhancement](Nereids) Automatic compute logical properties

Posted by GitBox <gi...@apache.org>.
morrySnow commented on code in PR #10176:
URL: https://github.com/apache/incubator-doris/pull/10176#discussion_r898740208


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalBinaryPlan.java:
##########
@@ -39,18 +41,29 @@
         implements BinaryPlan<LEFT_CHILD_TYPE, RIGHT_CHILD_TYPE> {
 
     public LogicalBinaryPlan(OP_TYPE operator, LEFT_CHILD_TYPE leftChild, RIGHT_CHILD_TYPE rightChild) {
-        super(NodeType.LOGICAL, operator, leftChild, rightChild);
+        super(NodeType.LOGICAL, operator, Optional.empty(), leftChild, rightChild);
     }
 
-    public LogicalBinaryPlan(OP_TYPE operator, GroupExpression groupExpression, LogicalProperties logicalProperties,
-            LEFT_CHILD_TYPE leftChild, RIGHT_CHILD_TYPE rightChild) {
+    public LogicalBinaryPlan(OP_TYPE operator, Optional<LogicalProperties> logicalProperties,
+                             LEFT_CHILD_TYPE leftChild, RIGHT_CHILD_TYPE rightChild) {
+        super(NodeType.LOGICAL, operator, logicalProperties, leftChild, rightChild);
+    }
+
+    public LogicalBinaryPlan(OP_TYPE operator, Optional<GroupExpression> groupExpression,
+             Optional<LogicalProperties> logicalProperties, LEFT_CHILD_TYPE leftChild, RIGHT_CHILD_TYPE rightChild) {
         super(NodeType.LOGICAL, operator, groupExpression, logicalProperties, leftChild, rightChild);
     }
 
     @Override
-    public LogicalBinaryPlan<OP_TYPE, Plan, Plan> newChildren(List<Plan> children) {
+    public LogicalBinaryPlan<OP_TYPE, Plan, Plan> withChildren(List<Plan> children) {
         Preconditions.checkArgument(children.size() == 2);
-        return new LogicalBinaryPlan(operator, groupExpression.orElse(null),
-                logicalProperties, children.get(0), children.get(1));
+        return new LogicalBinaryPlan(operator, groupExpression, Optional.empty(),
+            children.get(0), children.get(1));
+    }
+
+    @Override
+    public LogicalBinaryPlan<OP_TYPE, LEFT_CHILD_TYPE, RIGHT_CHILD_TYPE> withOutput(List<Slot> output) {
+        LogicalProperties logicalProperties = new LogicalProperties(output);

Review Comment:
   how can i do only update output in logical properties and leave the other attributes unchanged?



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


[GitHub] [incubator-doris] 924060929 commented on a diff in pull request #10176: [Enhancement](Nereids) Automatic compute logical properties

Posted by GitBox <gi...@apache.org>.
924060929 commented on code in PR #10176:
URL: https://github.com/apache/incubator-doris/pull/10176#discussion_r898823040


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalBinaryPlan.java:
##########
@@ -39,18 +41,29 @@
         implements BinaryPlan<LEFT_CHILD_TYPE, RIGHT_CHILD_TYPE> {
 
     public LogicalBinaryPlan(OP_TYPE operator, LEFT_CHILD_TYPE leftChild, RIGHT_CHILD_TYPE rightChild) {
-        super(NodeType.LOGICAL, operator, leftChild, rightChild);
+        super(NodeType.LOGICAL, operator, Optional.empty(), leftChild, rightChild);
     }
 
-    public LogicalBinaryPlan(OP_TYPE operator, GroupExpression groupExpression, LogicalProperties logicalProperties,
-            LEFT_CHILD_TYPE leftChild, RIGHT_CHILD_TYPE rightChild) {
+    public LogicalBinaryPlan(OP_TYPE operator, Optional<LogicalProperties> logicalProperties,
+                             LEFT_CHILD_TYPE leftChild, RIGHT_CHILD_TYPE rightChild) {
+        super(NodeType.LOGICAL, operator, logicalProperties, leftChild, rightChild);
+    }
+
+    public LogicalBinaryPlan(OP_TYPE operator, Optional<GroupExpression> groupExpression,
+             Optional<LogicalProperties> logicalProperties, LEFT_CHILD_TYPE leftChild, RIGHT_CHILD_TYPE rightChild) {
         super(NodeType.LOGICAL, operator, groupExpression, logicalProperties, leftChild, rightChild);
     }
 
     @Override
-    public LogicalBinaryPlan<OP_TYPE, Plan, Plan> newChildren(List<Plan> children) {
+    public LogicalBinaryPlan<OP_TYPE, Plan, Plan> withChildren(List<Plan> children) {
         Preconditions.checkArgument(children.size() == 2);
-        return new LogicalBinaryPlan(operator, groupExpression.orElse(null),
-                logicalProperties, children.get(0), children.get(1));
+        return new LogicalBinaryPlan(operator, groupExpression, Optional.empty(),
+            children.get(0), children.get(1));
+    }
+
+    @Override
+    public LogicalBinaryPlan<OP_TYPE, LEFT_CHILD_TYPE, RIGHT_CHILD_TYPE> withOutput(List<Slot> output) {
+        LogicalProperties logicalProperties = new LogicalProperties(output);

Review Comment:
   > maybe we need a function like withOutput for LogicalProperties
   
   done
   



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


[GitHub] [incubator-doris] EmmyMiao87 merged pull request #10176: [Enhancement](Nereids) Automatic compute logical properties

Posted by GitBox <gi...@apache.org>.
EmmyMiao87 merged PR #10176:
URL: https://github.com/apache/incubator-doris/pull/10176


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


[GitHub] [incubator-doris] github-actions[bot] commented on pull request #10176: [Enhancement](Nereids) Automatic compute logical properties

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #10176:
URL: https://github.com/apache/incubator-doris/pull/10176#issuecomment-1157736656

   PR approved by at least one committer and no changes requested.


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


[GitHub] [incubator-doris] 924060929 commented on a diff in pull request #10176: [Enhancement](Nereids) Automatic compute logical properties

Posted by GitBox <gi...@apache.org>.
924060929 commented on code in PR #10176:
URL: https://github.com/apache/incubator-doris/pull/10176#discussion_r898752667


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalBinaryPlan.java:
##########
@@ -39,18 +41,29 @@
         implements BinaryPlan<LEFT_CHILD_TYPE, RIGHT_CHILD_TYPE> {
 
     public LogicalBinaryPlan(OP_TYPE operator, LEFT_CHILD_TYPE leftChild, RIGHT_CHILD_TYPE rightChild) {
-        super(NodeType.LOGICAL, operator, leftChild, rightChild);
+        super(NodeType.LOGICAL, operator, Optional.empty(), leftChild, rightChild);
     }
 
-    public LogicalBinaryPlan(OP_TYPE operator, GroupExpression groupExpression, LogicalProperties logicalProperties,
-            LEFT_CHILD_TYPE leftChild, RIGHT_CHILD_TYPE rightChild) {
+    public LogicalBinaryPlan(OP_TYPE operator, Optional<LogicalProperties> logicalProperties,
+                             LEFT_CHILD_TYPE leftChild, RIGHT_CHILD_TYPE rightChild) {
+        super(NodeType.LOGICAL, operator, logicalProperties, leftChild, rightChild);
+    }
+
+    public LogicalBinaryPlan(OP_TYPE operator, Optional<GroupExpression> groupExpression,
+             Optional<LogicalProperties> logicalProperties, LEFT_CHILD_TYPE leftChild, RIGHT_CHILD_TYPE rightChild) {
         super(NodeType.LOGICAL, operator, groupExpression, logicalProperties, leftChild, rightChild);
     }
 
     @Override
-    public LogicalBinaryPlan<OP_TYPE, Plan, Plan> newChildren(List<Plan> children) {
+    public LogicalBinaryPlan<OP_TYPE, Plan, Plan> withChildren(List<Plan> children) {
         Preconditions.checkArgument(children.size() == 2);
-        return new LogicalBinaryPlan(operator, groupExpression.orElse(null),
-                logicalProperties, children.get(0), children.get(1));
+        return new LogicalBinaryPlan(operator, groupExpression, Optional.empty(),
+            children.get(0), children.get(1));
+    }
+
+    @Override
+    public LogicalBinaryPlan<OP_TYPE, LEFT_CHILD_TYPE, RIGHT_CHILD_TYPE> withOutput(List<Slot> output) {
+        LogicalProperties logicalProperties = new LogicalProperties(output);

Review Comment:
   maybe new LogicalProperties(newOutput, operator.computeOtherFields()) ?



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


[GitHub] [incubator-doris] 924060929 commented on a diff in pull request #10176: [Enhancement](Nereids) Automatic compute logical properties

Posted by GitBox <gi...@apache.org>.
924060929 commented on code in PR #10176:
URL: https://github.com/apache/incubator-doris/pull/10176#discussion_r898736515


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalBinaryPlan.java:
##########
@@ -39,18 +41,29 @@
         implements BinaryPlan<LEFT_CHILD_TYPE, RIGHT_CHILD_TYPE> {
 
     public LogicalBinaryPlan(OP_TYPE operator, LEFT_CHILD_TYPE leftChild, RIGHT_CHILD_TYPE rightChild) {
-        super(NodeType.LOGICAL, operator, leftChild, rightChild);
+        super(NodeType.LOGICAL, operator, Optional.empty(), leftChild, rightChild);
     }
 
-    public LogicalBinaryPlan(OP_TYPE operator, GroupExpression groupExpression, LogicalProperties logicalProperties,
-            LEFT_CHILD_TYPE leftChild, RIGHT_CHILD_TYPE rightChild) {
+    public LogicalBinaryPlan(OP_TYPE operator, Optional<LogicalProperties> logicalProperties,
+                             LEFT_CHILD_TYPE leftChild, RIGHT_CHILD_TYPE rightChild) {
+        super(NodeType.LOGICAL, operator, logicalProperties, leftChild, rightChild);
+    }
+
+    public LogicalBinaryPlan(OP_TYPE operator, Optional<GroupExpression> groupExpression,
+             Optional<LogicalProperties> logicalProperties, LEFT_CHILD_TYPE leftChild, RIGHT_CHILD_TYPE rightChild) {
         super(NodeType.LOGICAL, operator, groupExpression, logicalProperties, leftChild, rightChild);
     }
 
     @Override
-    public LogicalBinaryPlan<OP_TYPE, Plan, Plan> newChildren(List<Plan> children) {
+    public LogicalBinaryPlan<OP_TYPE, Plan, Plan> withChildren(List<Plan> children) {
         Preconditions.checkArgument(children.size() == 2);
-        return new LogicalBinaryPlan(operator, groupExpression.orElse(null),
-                logicalProperties, children.get(0), children.get(1));
+        return new LogicalBinaryPlan(operator, groupExpression, Optional.empty(),
+            children.get(0), children.get(1));
+    }
+
+    @Override
+    public LogicalBinaryPlan<OP_TYPE, LEFT_CHILD_TYPE, RIGHT_CHILD_TYPE> withOutput(List<Slot> output) {
+        LogicalProperties logicalProperties = new LogicalProperties(output);

Review Comment:
   LogicalLeaf(UnboundRelation).getLogicalProperties() will throw UnboundException.
   So can not invoke getLogicalProperties().withOutput(newOutput);



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


[GitHub] [incubator-doris] github-actions[bot] commented on pull request #10176: [Enhancement](Nereids) Automatic compute logical properties

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #10176:
URL: https://github.com/apache/incubator-doris/pull/10176#issuecomment-1157399786

   PR approved by anyone and no changes requested.


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