Skip to content

Commit

Permalink
Remove useless "hash table ready" states in swiss join
Browse files Browse the repository at this point in the history
  • Loading branch information
zanmato1984 committed Dec 31, 2024
1 parent 1e45e18 commit 70a56ae
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions cpp/src/arrow/acero/swiss_join.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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_);
Expand All @@ -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);
}
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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();

Expand Down Expand Up @@ -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_;

Expand All @@ -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.
Expand Down

0 comments on commit 70a56ae

Please sign in to comment.