mustafasrepo commented on code in PR #9815:
URL: https://github.com/apache/arrow-datafusion/pull/9815#discussion_r1542390079


##########
datafusion/sqllogictest/test_files/repartition.slt:
##########
@@ -121,9 +121,9 @@ Limit: skip=0, fetch=5
 --Filter: sink_table.c3 > Int16(0)
 ----TableScan: sink_table projection=[c1, c2, c3]
 physical_plan
-GlobalLimitExec: skip=0, fetch=5
---CoalescePartitionsExec
-----CoalesceBatchesExec: target_batch_size=8192
+CoalescePartitionsExec
+--GlobalLimitExec: skip=0, fetch=5

Review Comment:
   I think this change is not correct. We cannot push down `GlobalLimitExec` 
though `CoalescePartitionsExec`.  However, we can convert following pattern
   ```
   GlobalLimitExec: skip=0, fetch=5
   --CoalescePartitionsExec
   ```
   into
   ```
   GlobalLimitExec: skip=0, fetch=5
   --CoalescePartitionsExec
   ----LocalLimitExec: skip=0, fetch=5
   ```
   if skip is larger than 0. `LocalLimitExec` should still have `skip=0` wher 
fetch is `skip+global limit fetch`.
   



##########
datafusion/sqllogictest/test_files/repartition.slt:
##########
@@ -121,9 +121,9 @@ Limit: skip=0, fetch=5
 --Filter: sink_table.c3 > Int16(0)
 ----TableScan: sink_table projection=[c1, c2, c3]
 physical_plan
-GlobalLimitExec: skip=0, fetch=5
---CoalescePartitionsExec
-----CoalesceBatchesExec: target_batch_size=8192
+CoalescePartitionsExec
+--GlobalLimitExec: skip=0, fetch=5

Review Comment:
   I think this change is not correct. We cannot push down `GlobalLimitExec` 
though `CoalescePartitionsExec`.  However, we can convert following pattern
   ```
   GlobalLimitExec: skip=0, fetch=5
   --CoalescePartitionsExec
   ```
   into
   ```
   GlobalLimitExec: skip=0, fetch=5
   --CoalescePartitionsExec
   ----LocalLimitExec: skip=0, fetch=5
   ```
   if skip is larger than 0. `LocalLimitExec` should still have `skip=0` where 
fetch is `skip+global limit fetch`.
   



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

Reply via email to