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 06:07:48 UTC

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

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