This is an automated email from the ASF dual-hosted git repository. dataroaring pushed a commit to branch branch-3.0 in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-3.0 by this push: new 5cfb2459e34 [fix](load) fix memtable agg functions (#38017) (#38067) 5cfb2459e34 is described below commit 5cfb2459e34453fc3830e7b8a9982a85c23bda11 Author: Kaijie Chen <c...@apache.org> AuthorDate: Thu Jul 18 20:59:18 2024 +0800 [fix](load) fix memtable agg functions (#38017) (#38067) 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 74bd49a2bc4..207778becae 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