Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 3 additions & 1 deletion be/src/vec/exec/scan/scanner_scheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,9 @@ void ScannerScheduler::_scanner_scan(ScannerScheduler* scheduler, ScannerContext
ctx->return_free_block(block);
} else {
if (!blocks.empty() && blocks.back()->rows() + block->rows() <= state->batch_size()) {
vectorized::MutableBlock(blocks.back()).merge(*block);
vectorized::MutableBlock mutable_block(blocks.back());
mutable_block.merge(*block);
blocks.back()->set_columns(std::move(mutable_block.mutable_columns()));
ctx->return_free_block(block);
} else {
blocks.push_back(block);
Expand Down
11 changes: 5 additions & 6 deletions be/src/vec/exec/vunion_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,9 @@ Status VUnionNode::get_next_materialized(RuntimeState* state, Block* block) {
}
}

if (!mem_reuse) {
block->swap(mblock.to_block());
}

block->swap(mblock.to_block());


DCHECK_LE(_child_idx, _children.size());
return Status::OK();
Expand Down Expand Up @@ -204,9 +204,8 @@ Status VUnionNode::get_next_const(RuntimeState* state, Block* block) {
}
}

if (!mem_reuse) {
block->swap(mblock.to_block());
}

block->swap(mblock.to_block());

// some insert query like "insert into string_test select 1, repeat('a', 1024 * 1024);"
// the const expr will be in output expr cause the union node return a empty block. so here we
Expand Down