erratic-pattern opened a new pull request, #19360:
URL: https://github.com/apache/datafusion/pull/19360

   ## Which issue does this PR close?
   
   - Closes #19358
   
   ## Rationale for this change
   
   Join operators don't yield to the tokio runtime, which prevents query 
cancellation from working and causes long-running joins to be uncancellable.
   
   ## What changes are included in this PR?
   
   Wrap join streams with 
[`make_cooperative()`](https://github.com/apache/arrow-datafusion/blob/775277ae3cef7a97f0ca4868b4ccdfc03e9507ee/datafusion/physical-plan/src/coop.rs#L335)
 in each operator's `execute()` method:
   
   - 
[`HashJoinExec`](https://github.com/erratic-pattern/arrow-datafusion/blob/35f765d559db5b7d37380bca250787378d456897/datafusion/physical-plan/src/joins/hash_join/exec.rs#L1038)
   - 
[`SortMergeJoinExec`](https://github.com/erratic-pattern/arrow-datafusion/blob/35f765d559db5b7d37380bca250787378d456897/datafusion/physical-plan/src/joins/sort_merge_join/exec.rs#L500)
   - 
[`CrossJoinExec`](https://github.com/erratic-pattern/arrow-datafusion/blob/35f765d559db5b7d37380bca250787378d456897/datafusion/physical-plan/src/joins/cross_join.rs#L336-L347)
   - 
[`NestedLoopJoinExec`](https://github.com/erratic-pattern/arrow-datafusion/blob/35f765d559db5b7d37380bca250787378d456897/datafusion/physical-plan/src/joins/nested_loop_join.rs#L533)
   - 
[`SymmetricHashJoinExec`](https://github.com/erratic-pattern/arrow-datafusion/blob/35f765d559db5b7d37380bca250787378d456897/datafusion/physical-plan/src/joins/symmetric_hash_join.rs#L538-L558)
   
   ## Are these changes tested?
   
   I made a [standalone 
reproducer](https://github.com/erratic-pattern/datafusion-join-cancellation-repro)
 with tests, but they are too flaky to include in DataFusion test suite.
   
   Unsure of how to test this reliably in CI without introducing test flakiness 
/ timing issues.
   
   ## Are there any user-facing changes?
   
   No API changes.
   


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