EmmyMiao87 commented on code in PR #8947:
URL: https://github.com/apache/incubator-doris/pull/8947#discussion_r850064589


##########
fe/fe-core/src/main/java/org/apache/doris/planner/SingleNodePlanner.java:
##########
@@ -161,6 +163,8 @@ public PlanNode createSingleNodePlan() throws 
UserException, AnalysisException {
         if (LOG.isTraceEnabled()) {
             LOG.trace("desctbl: " + analyzer.getDescTbl().debugString());
         }
+        statsRecursiveDerive = new StatsRecursiveDerive();

Review Comment:
   Merge those two lines ~ Move 'create' into 'constructor'



##########
fe/fe-core/src/main/java/org/apache/doris/planner/PlanNode.java:
##########
@@ -170,12 +174,41 @@ protected PlanNode(PlanNodeId id, PlanNode node, String 
planNodeName) {
         this.planNodeName = VectorizedUtil.isVectorized() ?
                 "V" + planNodeName : planNodeName;
         this.numInstances = 1;
+        this.nodeType = node.getNodeType();
+        this.statsDeriveResult.set(node.getStatsDeriveResult());
+    }
+
+    public enum NodeType {
+        DEFAULT,
+        AGG_NODE,
+        OLAP_SCAN_NODE,
+        HASH_JOIN_NODE,
+        MERGE_NODE
     }
 
     public String getPlanNodeName() {
         return planNodeName;
     }
 
+    public StatsDeriveResult getStatsDeriveResult() {
+        if (statsDeriveResult == null) {
+            statsDeriveResult = new StatsDeriveResult();
+        }
+        return statsDeriveResult;
+    }
+
+    public NodeType getNodeType() {
+        return nodeType;
+    }
+
+    public void setStatsDeriveResult(StatsDeriveResult statsDeriveResult) {
+        this.statsDeriveResult = statsDeriveResult;
+    }
+
+    public void setNodeType(NodeType nodeType) {

Review Comment:
   Remove it. Set node type in constructor 



##########
fe/fe-core/src/main/java/org/apache/doris/planner/PlanNode.java:
##########
@@ -170,12 +174,41 @@ protected PlanNode(PlanNodeId id, PlanNode node, String 
planNodeName) {
         this.planNodeName = VectorizedUtil.isVectorized() ?
                 "V" + planNodeName : planNodeName;
         this.numInstances = 1;
+        this.nodeType = node.getNodeType();
+        this.statsDeriveResult.set(node.getStatsDeriveResult());
+    }
+
+    public enum NodeType {
+        DEFAULT,
+        AGG_NODE,
+        OLAP_SCAN_NODE,
+        HASH_JOIN_NODE,
+        MERGE_NODE
     }
 
     public String getPlanNodeName() {
         return planNodeName;
     }
 
+    public StatsDeriveResult getStatsDeriveResult() {
+        if (statsDeriveResult == null) {

Review Comment:
   Optional<StatsDeriveResult>



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to