This is an automated email from the ASF dual-hosted git repository. yiguolei pushed a commit to branch branch-2.1 in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-2.1 by this push: new 38885d4b00a [fix](load) fix memtable agg functions (#38017) (#38021) 38885d4b00a is described below commit 38885d4b00aa18186ff6857f41e0e16dfcc854a7 Author: Kaijie Chen <c...@apache.org> AuthorDate: Wed Jul 17 23:04:57 2024 +0800 [fix](load) fix memtable agg functions (#38017) (#38021) backport #38017 --- be/src/olap/memtable.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/be/src/olap/memtable.cpp b/be/src/olap/memtable.cpp index b3f3343a9c5..923849162db 100644 --- a/be/src/olap/memtable.cpp +++ b/be/src/olap/memtable.cpp @@ -182,19 +182,21 @@ Status MemTable::insert(const vectorized::Block* input_block, const std::vector<uint32_t>& row_idxs) { if (_is_first_insertion) { _is_first_insertion = false; - auto cloneBlock = input_block->clone_without_columns(&_column_offset); - _input_mutable_block = vectorized::MutableBlock::build_mutable_block(&cloneBlock); + auto clone_block = input_block->clone_without_columns(&_column_offset); + _input_mutable_block = vectorized::MutableBlock::build_mutable_block(&clone_block); _vec_row_comparator->set_block(&_input_mutable_block); - _output_mutable_block = vectorized::MutableBlock::build_mutable_block(&cloneBlock); + _output_mutable_block = vectorized::MutableBlock::build_mutable_block(&clone_block); if (_keys_type != KeysType::DUP_KEYS) { - _init_agg_functions(input_block); + // there may be additional intermediate columns in input_block + // we only need columns indicated by column offset in the output + _init_agg_functions(&clone_block); } if (_tablet_schema->has_sequence_col()) { if (_is_partial_update) { // for unique key partial update, sequence column index in block // may be different with the index in `_tablet_schema` - for (size_t i = 0; i < cloneBlock.columns(); i++) { - if (cloneBlock.get_by_position(i).name == SEQUENCE_COL) { + for (size_t i = 0; i < clone_block.columns(); i++) { + if (clone_block.get_by_position(i).name == SEQUENCE_COL) { _seq_col_idx_in_block = i; break; } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org