Skip to content

Commit

Permalink
fix tmp block clear
Browse files Browse the repository at this point in the history
  • Loading branch information
eldenmoon committed Mar 28, 2024
1 parent b1b6708 commit 932c624
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions be/src/vec/exec/scan/vscanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "common/config.h"
#include "pipeline/exec/scan_operator.h"
#include "runtime/descriptors.h"
#include "util/defer_op.h"
#include "util/runtime_profile.h"
#include "vec/core/column_with_type_and_name.h"
#include "vec/exec/scan/vscan_node.h"
Expand Down Expand Up @@ -152,19 +153,21 @@ Status VScanner::get_block(RuntimeState* state, Block* block, bool* eof) {
}

Status VScanner::_filter_output_block(Block* block) {
Defer clear_tmp_block([&]() {
auto all_column_names = block->get_names();
for (auto& name : all_column_names) {
if (name.rfind(BeConsts::BLOCK_TEMP_COLUMN_PREFIX, 0) == 0) {
block->erase(name);
}
}
});
if (block->has(BeConsts::BLOCK_TEMP_COLUMN_SCANNER_FILTERED)) {
// scanner filter_block is already done (only by _topn_next currently), just skip it
return Status::OK();
}
auto old_rows = block->rows();
Status st = VExprContext::filter_block(_conjuncts, block, block->columns());
_counter.num_rows_unselected += old_rows - block->rows();
auto all_column_names = block->get_names();
for (auto& name : all_column_names) {
if (name.rfind(BeConsts::BLOCK_TEMP_COLUMN_PREFIX, 0) == 0) {
block->erase(name);
}
}
return st;
}

Expand Down

0 comments on commit 932c624

Please sign in to comment.