eldenmoon commented on code in PR #26749:
URL: https://github.com/apache/doris/pull/26749#discussion_r1393695979


##########
be/src/olap/rowset/segment_v2/segment_iterator.cpp:
##########
@@ -1632,19 +1685,35 @@ void SegmentIterator::_init_current_block(
     for (size_t i = 0; i < _schema->num_column_ids(); i++) {
         auto cid = _schema->column_id(i);
         auto column_desc = _schema->column(cid);
-        // the column in block must clear() here to insert new data
-        if (_is_pred_column[cid] ||
-            i >= block->columns()) { //todo(wb) maybe we can release it after 
output block
-            current_columns[cid]->clear();
-        } else { // non-predicate column
-            current_columns[cid] = 
std::move(*block->get_by_position(i).column).mutate();
-
-            if (column_desc->type() == FieldType::OLAP_FIELD_TYPE_DATE) {
-                current_columns[cid]->set_date_type();
-            } else if (column_desc->type() == 
FieldType::OLAP_FIELD_TYPE_DATETIME) {
-                current_columns[cid]->set_datetime_type();
-            }
+        if (!_is_pred_column[cid] &&
+            !_segment->same_with_storage_type(

Review Comment:
   Add CHECK in `same_with_storage_type`  to make sure continue in variant case



-- 
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

Reply via email to