zanmato1984 commented on code in PR #45918:
URL: https://github.com/apache/arrow/pull/45918#discussion_r2013296079


##########
cpp/src/arrow/acero/swiss_join.cc:
##########
@@ -2414,12 +2438,20 @@ Status JoinProbeProcessor::OnFinished() {
   // Flush all instances of materialize that have non-zero accumulated output
   // rows.
   //
-  for (size_t i = 0; i < materialize_.size(); ++i) {
-    JoinResultMaterialize& materialize = *materialize_[i];
-    RETURN_NOT_OK(materialize.Flush(
-        [&](ExecBatch batch) { return output_batch_fn_(i, std::move(batch)); 
}));
+  if (!is_parallel_) {

Review Comment:
   I think you don't need the cv at all, which is also why I was suggesting to 
move the control flow inside `SwissJoin`, where you can orchestrate the task 
dependencies in a `TaskGroup/Continuation` fashion w/o any explicit 
synchronizations.



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