This is an automated email from the ASF dual-hosted git repository.
zanmato pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/main by this push:
new 1df4889505 GH-45135: [C++] Remove useless "hash table ready" states in
swiss join (#45136)
1df4889505 is described below
commit 1df4889505bb2256d7c3738e9c3218ef23d3f72c
Author: Rossi Sun <[email protected]>
AuthorDate: Tue Dec 31 22:37:18 2024 +0800
GH-45135: [C++] Remove useless "hash table ready" states in swiss join
(#45136)
### Rationale for this change
See #45135
### What changes are included in this PR?
Remove the useless states.
### Are these changes tested?
Existing tests suffice.
### Are there any user-facing changes?
None.
* GitHub Issue: #45135
Authored-by: Rossi Sun <[email protected]>
Signed-off-by: Rossi Sun <[email protected]>
---
cpp/src/arrow/acero/swiss_join.cc | 10 ----------
1 file changed, 10 deletions(-)
diff --git a/cpp/src/arrow/acero/swiss_join.cc
b/cpp/src/arrow/acero/swiss_join.cc
index 53092c898e..c88279fd54 100644
--- a/cpp/src/arrow/acero/swiss_join.cc
+++ b/cpp/src/arrow/acero/swiss_join.cc
@@ -2462,7 +2462,6 @@ class SwissJoin : public HashJoinImpl {
output_batch_callback_ = std::move(output_batch_callback);
finished_callback_ = std::move(finished_callback);
- hash_table_ready_.store(false);
cancelled_.store(false);
{
std::lock_guard<std::mutex> lock(state_mutex_);
@@ -2474,7 +2473,6 @@ class SwissJoin : public HashJoinImpl {
local_states_.resize(num_threads_);
for (int i = 0; i < num_threads_; ++i) {
RETURN_NOT_OK(local_states_[i].stack.Init(pool_, kTempStackUsage));
- local_states_[i].hash_table_ready = false;
local_states_[i].num_output_batches = 0;
local_states_[i].materialize.Init(pool_, proj_map_left, proj_map_right);
}
@@ -2520,11 +2518,6 @@ class SwissJoin : public HashJoinImpl {
return status();
}
- if (!local_states_[thread_index].hash_table_ready) {
- local_states_[thread_index].hash_table_ready = hash_table_ready_.load();
- }
- ARROW_DCHECK(local_states_[thread_index].hash_table_ready);
-
ExecBatch keypayload_batch;
ARROW_ASSIGN_OR_RAISE(keypayload_batch, KeyPayloadFromInput(/*side=*/0,
&batch));
arrow::util::TempVectorStack* temp_stack =
&local_states_[thread_index].stack;
@@ -2689,7 +2682,6 @@ class SwissJoin : public HashJoinImpl {
hash_table_.payloads(),
hash_table_.key_to_payload()
== nullptr);
}
- hash_table_ready_.store(true);
residual_filter_.OnBuildFinished();
@@ -2910,7 +2902,6 @@ class SwissJoin : public HashJoinImpl {
JoinResultMaterialize materialize;
std::vector<KeyColumnArray> temp_column_arrays;
int64_t num_output_batches;
- bool hash_table_ready;
};
std::vector<ThreadLocalState> local_states_;
@@ -2927,7 +2918,6 @@ class SwissJoin : public HashJoinImpl {
// The other flags that follow them, protected by mutex, will be queried or
// updated only a fixed number of times during entire join processing.
//
- std::atomic<bool> hash_table_ready_;
std::atomic<bool> cancelled_;
// Mutex protecting state flags.