morrySnow commented on code in PR #12441:
URL: https://github.com/apache/doris/pull/12441#discussion_r965591870


##########
fe/fe-core/src/main/java/org/apache/doris/analysis/AggregateInfo.java:
##########
@@ -834,6 +834,31 @@ public void updateTypeOfAggregateExprs() {
         }
     }
 
+    public void updateMaterializedSlots() {
+        // why output and intermediate may have different materialized slots?
+        // because some slot is materialized by materializeSrcExpr method 
directly
+        // in that case, only output slots is materialized
+        // assume output tuple has correct marterialized infomation
+        // we update intermediate tuple and materializedSlots based on output 
tuple
+        materializedSlots.clear();
+        ArrayList<SlotDescriptor> outputSlots = outputTupleDesc.getSlots();
+        int groupingExprNum = groupingExprs != null ? groupingExprs.size() : 0;
+        Preconditions.checkState(groupingExprNum <= outputSlots.size());
+        for (int i = groupingExprNum; i < outputSlots.size(); ++i) {
+            if (outputSlots.get(i).isMaterialized()) {
+                materializedSlots.add(i - groupingExprNum);
+            }
+        }
+        outputTupleDesc.computeStatAndMemLayout();

Review Comment:
   why need yo re-compute output's layout?



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