metesynnada commented on code in PR #4694:
URL: https://github.com/apache/arrow-datafusion/pull/4694#discussion_r1058140461


##########
datafusion/core/src/execution/context.rs:
##########
@@ -1582,6 +1575,8 @@ impl SessionState {
         // Repartition rule could introduce additional RepartitionExec with 
RoundRobin partitioning.
         // To make sure the SinglePartition is satisfied, run the 
BasicEnforcement again, originally it was the AddCoalescePartitionsExec here.
         physical_optimizers.push(Arc::new(BasicEnforcement::new()));
+        physical_optimizers.push(Arc::new(PipelineChecker::new()));
+        physical_optimizers.push(Arc::new(BasicEnforcement::new()));

Review Comment:
   Actually, we could end up changing the output partitioning of the 
`HashJoinExec`. This is why I add `BasicEnforcement` after the 
`PipelineChecker` rule. My motivation was if we broke something, 
`BasicEnforcement` would fix it. However, I realize that it will not delete 
unnecessary `RepartitionExec`. Also, it can add `SortExec` after the 
`PipelineChecker` rule. Overall, thanks for pointing out the issue, I and 
@ozankabak will discuss the place for "changing execution plan" and 
"gatekeeping" again.



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