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:25:50 UTC

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

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