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


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/glue/translator/PhysicalPlanTranslator.java:
##########
@@ -1829,9 +1829,17 @@ public PlanFragment visitPhysicalNestedLoopJoin(
     public PlanFragment visitPhysicalLimit(PhysicalLimit<? extends Plan> 
physicalLimit, PlanTranslatorContext context) {
         PlanFragment inputFragment = physicalLimit.child(0).accept(this, 
context);
         PlanNode child = inputFragment.getPlanRoot();
-        child.setLimit(MergeLimits.mergeLimit(physicalLimit.getLimit(), 
physicalLimit.getOffset(), child.getLimit()));
-        // TODO: plan node don't support limit
-        // child.setOffset(MergeLimits.mergeOffset(physicalLimit.getOffset(), 
child.getOffset()));
+
+        if (!(child instanceof ExchangeNode)) {

Review Comment:
   1. remove post process: AddOffsetIntoDistribute
   2. in translator
   2.1. if limit is local, just merge it with child.getLimit() and set it to 
child.limit
   2.2. if limit is global, check wether it's child is exchange. if child is 
exchange, just merge limit and offset with exchange's limit and offset. if 
child is not exchange, create exchange node and set limit and offset to it 



-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to