AdamGS commented on code in PR #27804:
URL: https://github.com/apache/datafusion/pull/27804#discussion_r4722619559
##########
datafusion/physical-plan/src/repartition/mod.rs:
##########
@@ -1812,12 +1812,15 @@ impl ExecutionPlan for RepartitionExec {
.remove(&partition)
.expect("partition not used yet");
- (
- rx,
- reservation,
- spill_readers,
- Arc::clone(&state.abort_helper),
- )
+ // The last output partition takes the handle. Otherwise the
plan node
+ // keeps the input tasks alive after every output stream drops.
+ let abort_helper = if state.channels.is_empty() {
+ std::mem::take(&mut state.abort_helper)
Review Comment:
I've considered an additional state or maybe `Option<Arc<...>>`, but I think
this is the simplest way to achieve this.
--
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]