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


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/SetPreAggStatus.java:
##########
@@ -204,23 +206,24 @@ public Plan visitLogicalProject(LogicalProject<? extends 
Plan> logicalProject,
     @Override
     public Plan visitLogicalAggregate(LogicalAggregate<? extends Plan> 
logicalAggregate,
             Stack<PreAggInfoContext> context) {
+        PreAggInfoContext preAggInfoContext = new PreAggInfoContext();
+        context.push(preAggInfoContext);
         Plan plan = super.visit(logicalAggregate, context);
-        if (!context.isEmpty()) {
-            PreAggInfoContext preAggInfoContext = context.pop();
-            
preAggInfoContext.olapScanIds.retainAll(logicalAggregate.child().getInputRelations());
-            
preAggInfoContext.addAggregateFunctions(logicalAggregate.getAggregateFunctions());
-            
preAggInfoContext.addGroupByExpresssions(logicalAggregate.getGroupByExpressions());
-            for (RelationId id : preAggInfoContext.olapScanIds) {
-                olapScanPreAggContexts.put(id, preAggInfoContext);
-            }
+        PreAggInfoContext popped = context.pop();
+        Preconditions.checkState(popped == preAggInfoContext,
+                "PreAggInfoContext stack mismatch in visitLogicalAggregate");

Review Comment:
   不要直接check了,看看弄个容错处理。然后fedebug模式开了,再check



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