englefly commented on code in PR #64330:
URL: https://github.com/apache/doris/pull/64330#discussion_r3388345927


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/PullUpProjectExprUnderTopN.java:
##########
@@ -244,6 +244,13 @@ private static void collectFromNode(Plan node, PullUpInfo 
info, Set<ExprId> bloc
             for (NamedExpression ne : project.getProjects()) {
                 if (canPullUp(ne) && !blockedExprIds.contains(ne.getExprId())) 
{
                     info.addPulledUpExpr(project, ne);
+                } else if (ne instanceof Alias && ne.child(0) instanceof Slot) 
{
+                    // Chain: this intermediate project renames a slot that may
+                    // come from a pulled-up expression deeper in the tree.
+                    // Register Slot(alias.toSlot()) → child Slot so that
+                    // getPullUpReplaceExpression can resolve the chain later.
+                    context.pullUpExprReplaceMap.putIfAbsent(ne.toSlot(), 
ne.child(0));
+                    blockedExprIds.add(((Slot) ne.child(0)).getExprId());

Review Comment:
   我不认为这个是问题



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