zhuqi-lucas commented on code in PR #14418:
URL: https://github.com/apache/datafusion/pull/14418#discussion_r1939604791


##########
datafusion/physical-optimizer/src/limit_pushdown.rs:
##########
@@ -146,6 +146,14 @@ pub fn pushdown_limit_helper(
         global_state.skip = skip;
         global_state.fetch = fetch;
 
+        if limit_exec.input().as_any().is::<CoalescePartitionsExec>() {
+            // If the child is a `CoalescePartitionsExec`, we should not 
remove the limit
+            // the push_down through the `CoalescePartitionsExec` to each 
partition will not guarantee the limit.
+            // todo we may have a better solution if we can support with_fetch 
for limit inside CoalescePartitionsExec.

Review Comment:
   Thank you @xudong963  for review, change the comments, and added a follow-up 
issue:
   https://github.com/apache/datafusion/issues/14446 



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