This is an automated email from the ASF dual-hosted git repository.

yangzhg pushed a commit to branch branch-1.1-lts
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-1.1-lts by this push:
     new a673c80dfc [branch-1.1-lts](fix) SegmentIterator return columns 
missing ColumnNullable #16942
a673c80dfc is described below

commit a673c80dfc6d97c0807c1d844312f973b381621f
Author: camby <104178...@qq.com>
AuthorDate: Tue Feb 21 12:34:50 2023 +0800

    [branch-1.1-lts](fix) SegmentIterator return columns missing ColumnNullable 
#16942
    
    Co-authored-by: cambyzju <zhuxiaol...@baidu.com>
---
 be/src/olap/rowset/segment_v2/column_reader.cpp    | 1 +
 be/src/olap/rowset/segment_v2/segment_iterator.cpp | 8 ++++++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/be/src/olap/rowset/segment_v2/column_reader.cpp 
b/be/src/olap/rowset/segment_v2/column_reader.cpp
index cb63240075..4a2e646cf3 100644
--- a/be/src/olap/rowset/segment_v2/column_reader.cpp
+++ b/be/src/olap/rowset/segment_v2/column_reader.cpp
@@ -679,6 +679,7 @@ Status FileColumnIterator::read_by_rowids(const rowid_t* 
rowids, const size_t co
                         auto* null_col =
                                 
vectorized::check_and_get_column<vectorized::ColumnNullable>(dst);
                         if (UNLIKELY(null_col == nullptr)) {
+                            LOG(WARNING) << "Column " << dst->get_name() << " 
should be Nullable";
                             return Status::InternalError("unexpected column 
type in column reader");
                         }
 
diff --git a/be/src/olap/rowset/segment_v2/segment_iterator.cpp 
b/be/src/olap/rowset/segment_v2/segment_iterator.cpp
index 3f109bb68b..35dc908546 100644
--- a/be/src/olap/rowset/segment_v2/segment_iterator.cpp
+++ b/be/src/olap/rowset/segment_v2/segment_iterator.cpp
@@ -939,8 +939,12 @@ Status SegmentIterator::next_batch(vectorized::Block* 
block) {
                 // 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->type())->create_column();
+                auto data_type = 
Schema::get_data_type_ptr(column_desc->type());
+                if (column_desc->is_nullable()) {
+                    data_type =
+                            
std::make_shared<vectorized::DataTypeNullable>(std::move(data_type));
+                }
+                _current_return_columns[cid] = data_type->create_column();
                 _current_return_columns[cid]->reserve(_opts.block_row_max);
             }
         }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to