Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cherry-pick](branch-21) reuse the join block to reduce malloc memory (#43738) #44349

Merged
merged 1 commit into from
Nov 22, 2024
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
16 changes: 6 additions & 10 deletions be/src/pipeline/exec/nested_loop_join_probe_operator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -523,24 +523,20 @@ Status NestedLoopJoinProbeOperatorX::pull(RuntimeState* state, vectorized::Block
local_state._matched_rows_done
: local_state._matched_rows_done);

size_t join_block_column_size = local_state._join_block.columns();
{
vectorized::Block tmp_block = local_state._join_block;

// Here make _join_block release the columns' ptr
local_state._join_block.set_columns(local_state._join_block.clone_empty_columns());

local_state.add_tuple_is_null_column(&tmp_block);
local_state.add_tuple_is_null_column(&local_state._join_block);
{
SCOPED_TIMER(local_state._join_filter_timer);
RETURN_IF_ERROR(vectorized::VExprContext::filter_block(
local_state._conjuncts, &tmp_block, tmp_block.columns()));
local_state._conjuncts, &local_state._join_block,
local_state._join_block.columns()));
}
RETURN_IF_ERROR_OR_CATCH_EXCEPTION(
local_state._build_output_block(&tmp_block, block, false));
local_state._build_output_block(&local_state._join_block, block, false));
local_state._reset_tuple_is_null_column();
}
local_state._join_block.clear_column_data();

local_state._join_block.clear_column_data(join_block_column_size);
if (!(*eos) and !local_state._need_more_input_data) {
auto func = [&](auto&& join_op_variants, auto set_build_side_flag,
auto set_probe_side_flag) {
Expand Down
Loading