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


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/glue/translator/PhysicalPlanTranslator.java:
##########
@@ -1827,9 +1827,15 @@ public PlanFragment visitPhysicalNestedLoopJoin(
 
     @Override
     public PlanFragment visitPhysicalLimit(PhysicalLimit<? extends Plan> 
physicalLimit, PlanTranslatorContext context) {
+        Plan childPlan = physicalLimit.child(0);
         PlanFragment inputFragment = physicalLimit.child(0).accept(this, 
context);
         PlanNode child = inputFragment.getPlanRoot();
-        child.setLimit(MergeLimits.mergeLimit(physicalLimit.getLimit(), 
physicalLimit.getOffset(), child.getLimit()));
+        if (childPlan instanceof PhysicalLimit) {

Review Comment:
   the better way fix this problem
   1. revert this PR #29789
   2. translate global limit into exchange, if its child is not a exchange 
node. refer to 
org.apache.doris.nereids.glue.translator.PhysicalPlanTranslator#visitPhysicalTopN



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