Skip to content

Commit

Permalink
disable mem save code in shuffle
Browse files Browse the repository at this point in the history
  • Loading branch information
HappenLee committed Oct 1, 2024
1 parent ea29138 commit 9d0cde0
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 9 deletions.
3 changes: 1 addition & 2 deletions be/src/pipeline/exec/hashjoin_build_sink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ Status HashJoinBuildSinkLocalState::close(RuntimeState* state, Status exec_statu
if (_shared_state->build_block) {
// release the memory of unused column in probe stage
_shared_state->build_block->clear_column_mem_not_keep(
p._should_keep_column_flags, p._shared_hash_table_context.get() != nullptr);
p._should_keep_column_flags, bool(p._shared_hashtable_controller));
}
}

Expand Down Expand Up @@ -596,7 +596,6 @@ Status HashJoinBuildSinkOperatorX::sink(RuntimeState* state, vectorized::Block*
_shared_hash_table_context->build_indexes_null =
local_state._shared_state->build_indexes_null;
local_state._runtime_filter_slots->copy_to_shared_context(_shared_hash_table_context);
_shared_hashtable_controller->signal(node_id());
}
} else if (!local_state._should_build_hash_table) {
DCHECK(_shared_hashtable_controller != nullptr);
Expand Down
4 changes: 3 additions & 1 deletion be/src/vec/core/block.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,9 @@ void Block::clear_column_mem_not_keep(const std::vector<bool>& column_keep_flags
}
}

if (need_keep_first && data[0].column->size() != origin_rows) {
if (need_keep_first && data.size() == column_keep_flags.size() &&
std::all_of(column_keep_flags.begin(), column_keep_flags.end(),
[](bool v) { return !v; })) {
auto first_column = data[0].column->clone_empty();
first_column->resize(origin_rows);
data[0].column = std::move(first_column);
Expand Down
6 changes: 1 addition & 5 deletions be/src/vec/runtime/shared_hash_table_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ SharedHashTableContextPtr SharedHashTableController::get_context(int my_node_id)
return _shared_contexts[my_node_id];
}

void SharedHashTableController::signal(int my_node_id) {
void SharedHashTableController::signal_finish(int my_node_id) {
std::lock_guard<std::mutex> lock(_mutex);
auto it = _shared_contexts.find(my_node_id);
if (it != _shared_contexts.cend()) {
Expand All @@ -52,10 +52,6 @@ void SharedHashTableController::signal(int my_node_id) {
for (auto& dep : _dependencies[my_node_id]) {
dep->set_ready();
}
}

void SharedHashTableController::signal_finish(int my_node_id) {
std::lock_guard<std::mutex> lock(_mutex);
for (auto& dep : _finish_dependencies[my_node_id]) {
dep->set_ready();
}
Expand Down
1 change: 0 additions & 1 deletion be/src/vec/runtime/shared_hash_table_controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ class SharedHashTableController {
void set_builder_and_consumers(TUniqueId builder, int node_id);
TUniqueId get_builder_fragment_instance_id(int my_node_id);
SharedHashTableContextPtr get_context(int my_node_id);
void signal(int my_node_id);
void signal_finish(int my_node_id);
void append_dependency(int node_id, std::shared_ptr<pipeline::Dependency> dep,
std::shared_ptr<pipeline::Dependency> finish_dep) {
Expand Down

0 comments on commit 9d0cde0

Please sign in to comment.