Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Upper level logic

bool hash_table_ready_ = false;
guarantees the readiness of the hash table by calling the interfaces (impl_->BuildHashTable and impl_->ProbeSingleBatch) in sequence so we don't actually have to do it all over.


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
Loading