westonpace commented on code in PR #12845:
URL: https://github.com/apache/arrow/pull/12845#discussion_r846429806


##########
cpp/src/arrow/compute/exec/hash_join.cc:
##########
@@ -103,7 +103,8 @@ class HashJoinBasicImpl : public HashJoinImpl {
     filter_ = std::move(filter);
     output_batch_callback_ = std::move(output_batch_callback);
     finished_callback_ = std::move(finished_callback);
-    local_states_.resize(num_threads + 1);  // +1 for calling thread + worker 
threads
+    // Adding ten, since each side of join might have an IO thread being 
called from.

Review Comment:
   Can you add `TODO(ARROW-15732)` to this comment so we know when to clean it 
up?



##########
cpp/src/arrow/compute/exec/hash_join.cc:
##########
@@ -103,7 +103,8 @@ class HashJoinBasicImpl : public HashJoinImpl {
     filter_ = std::move(filter);
     output_batch_callback_ = std::move(output_batch_callback);
     finished_callback_ = std::move(finished_callback);
-    local_states_.resize(num_threads + 1);  // +1 for calling thread + worker 
threads
+    // Adding ten, since each side of join might have an IO thread being 
called from.
+    local_states_.resize(num_threads + 10);

Review Comment:
   ```suggestion
       local_states_.resize(GetCpuThreadPoolCapacity() + 
io::GetIOThreadPoolCapacity() + 1);
   ```
   This is slightly less arbitrary than 10 and we'd have to be doing something 
truly weird to go over this value.



-- 
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: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to