Dandandan commented on a change in pull request #55:
URL: https://github.com/apache/arrow-datafusion/pull/55#discussion_r619791903



##########
File path: datafusion/src/physical_optimizer/coalesce_batches.rs
##########
@@ -58,7 +59,17 @@ impl PhysicalOptimizerRule for CoalesceBatches {
         // See https://issues.apache.org/jira/browse/ARROW-11068
         let wrap_in_coalesce = plan_any.downcast_ref::<FilterExec>().is_some()
             || plan_any.downcast_ref::<HashJoinExec>().is_some()
-            || plan_any.downcast_ref::<RepartitionExec>().is_some();
+            || {
+                match plan_any.downcast_ref::<RepartitionExec>() {
+                    Some(p) => match p.partitioning() {
+                        // do not coalesce hash partitions since other plans 
like partitioned hash

Review comment:
       I think this should be something to be solved in the hash join 
implementation, so if we merge this as is I think that deserves a github issue.
   Also you might want to use the matches macro here: `if 
matches!(p.partitioning(), Partitioning::Hash(_, _))` 




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to