yiguolei commented on code in PR #10460:
URL: https://github.com/apache/doris/pull/10460#discussion_r907920966
##########
be/src/olap/rowset/segment_v2/segment_iterator.cpp:
##########
@@ -1007,21 +1010,23 @@ Status SegmentIterator::next_batch(vectorized::Block*
block) {
for (size_t i = 0; i < _schema.num_column_ids(); i++) {
auto cid = _schema.column_id(i);
auto column_desc = _schema.column(cid);
- if (_is_first_read_column[cid]) {
- _current_return_columns[cid] =
Schema::get_predicate_column_nullable_ptr(
- column_desc->type(), column_desc->is_nullable());
- _current_return_columns[cid]->reserve(_opts.block_row_max);
- } else if (i >= block->columns()) {
- // if i >= block->columns means the column and not the
pred_column means `column i` is
- // a delete condition column. but the column is not effective
in the segment. so we just
- // create a column to hold the data.
- // a. origin data -> b. delete condition -> c. new load data
- // the segment of c do not effective delete condition, but it
still need read the column
- // to match the schema.
- // TODO: skip read the not effective delete column to speed up
segment read.
- _current_return_columns[cid] =
-
Schema::get_data_type_ptr(*column_desc)->create_column();
- _current_return_columns[cid]->reserve(_opts.block_row_max);
+ if (_is_need_vec_eval || _is_need_short_eval) {
+ if (_is_predicate_column[cid]) {
+ _current_return_columns[cid] =
Schema::get_predicate_column_nullable_ptr(
+ column_desc->type(), column_desc->is_nullable());
+ _current_return_columns[cid]->reserve(_opts.block_row_max);
+ } else if (_is_first_read_column[cid] || i >=
block->columns()) {
+ // if i >= block->columns means the column and not the
pred_column means `column i` is
+ // a delete condition column. but the column is not
effective in the segment. so we just
+ // create a column to hold the data.
+ // a. origin data -> b. delete condition -> c. new load
data
+ // the segment of c do not effective delete condition, but
it still need read the column
+ // to match the schema.
+ // TODO: skip read the not effective delete column to
speed up segment read.
+ _current_return_columns[cid] =
+
Schema::get_data_type_ptr(*column_desc)->create_column();
Review Comment:
这个地方是不对的: 对于block 中已经有的column,他原本是要做内存重用的,不会在这生成column
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]