eldenmoon commented on code in PR #26749: URL: https://github.com/apache/doris/pull/26749#discussion_r1393617499
########## be/src/olap/rowset/segment_v2/segment_iterator.h: ########## @@ -224,16 +227,46 @@ class SegmentIterator : public RowwiseIterator { uint16_t* sel_rowid_idx, size_t select_size, vectorized::MutableColumns* mutable_columns); + Status copy_column_data_by_selector(vectorized::IColumn* input_col_ptr, + vectorized::MutableColumnPtr& output_col, + uint16_t* sel_rowid_idx, uint16_t select_size, + size_t batch_size); + template <class Container> [[nodiscard]] Status _output_column_by_sel_idx(vectorized::Block* block, const Container& column_ids, uint16_t* sel_rowid_idx, uint16_t select_size) { SCOPED_RAW_TIMER(&_opts.stats->output_col_ns); for (auto cid : column_ids) { int block_cid = _schema_block_id_map[cid]; - RETURN_IF_ERROR(block->copy_column_data_to_block(_current_return_columns[cid].get(), - sel_rowid_idx, select_size, block_cid, + // Only the additional deleted filter condition need to materialize column be at the end of the block + // We should not to materialize the column of query engine do not need. So here just return OK. + // Eg: + // `delete from table where a = 10;` + // `select b from table;` + // a column only effective in segment iterator, the block from query engine only contain the b column. + // so the `block_cid >= data.size()` is true + if (block_cid >= block->columns()) { + continue; Review Comment: The Block interface should remain oblivious to storage details, making the use of args within it somewhat peculiar. Considering that copy_column_data_to_block is exclusively utilized in the segment iterator, its removal might be a viable option -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org