[Fix](topn opt) prevent from merge __TEMP__ column in segment iterator (#29121)

This commit is contained in:
lihangyu
2023-12-27 15:42:48 +08:00
committed by GitHub
parent 0607760efa
commit cfed36afbf

View File

@ -255,11 +255,14 @@ Status VCollectIterator::_topn_next(Block* block) {
auto clone_block = block->clone_empty();
MutableBlock mutable_block = vectorized::MutableBlock::build_mutable_block(&clone_block);
// clear TMPE columns to avoid column align problem in mutable_block.add_rows bellow
// clear TEMP columns to avoid column align problem in mutable_block.add_rows bellow
auto all_column_names = mutable_block.get_names();
for (auto& name : all_column_names) {
if (name.rfind(BeConsts::BLOCK_TEMP_COLUMN_PREFIX, 0) == 0) {
mutable_block.erase(name);
// clear TEMP columns from block to prevent from storage engine merge with this
// fake column
block->erase(name);
}
}