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

morningman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 88115ffcb3 [feature-wip](array-type) ArrayFileColumnIterator bug fix 
(#9114)
88115ffcb3 is described below

commit 88115ffcb38726ad87df59b4a98cf76b892b35b1
Author: camby <[email protected]>
AuthorDate: Tue Apr 26 09:35:46 2022 +0800

    [feature-wip](array-type) ArrayFileColumnIterator bug fix (#9114)
---
 be/src/olap/rowset/segment_v2/column_reader.cpp    | 3 ++-
 be/src/olap/rowset/segment_v2/column_reader.h      | 2 +-
 be/src/olap/rowset/segment_v2/segment_iterator.cpp | 7 +++++++
 3 files changed, 10 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 9f6e642292..d39302f000 100644
--- a/be/src/olap/rowset/segment_v2/column_reader.cpp
+++ b/be/src/olap/rowset/segment_v2/column_reader.cpp
@@ -417,7 +417,8 @@ Status ArrayFileColumnIterator::next_batch(size_t* n, 
ColumnBlockView* dst, bool
     array_batch->get_offset_by_length(dst->current_offset(), *n);
 
     // 2. read null
-    if (dst->is_nullable()) {
+    if (_array_reader->is_nullable()) {
+        DCHECK(dst->is_nullable());
         auto null_batch = array_batch->get_null_as_batch();
         ColumnBlock null_block(&null_batch, nullptr);
         ColumnBlockView null_view(&null_block, dst->current_offset());
diff --git a/be/src/olap/rowset/segment_v2/column_reader.h 
b/be/src/olap/rowset/segment_v2/column_reader.h
index 75dd2d1788..305ba5f8dc 100644
--- a/be/src/olap/rowset/segment_v2/column_reader.h
+++ b/be/src/olap/rowset/segment_v2/column_reader.h
@@ -351,7 +351,7 @@ public:
             ordinal_t start_offset_in_this_page =
                     
_length_iterator->get_current_page()->first_array_item_ordinal;
             ColumnBlock ordinal_block(_length_batch.get(), nullptr);
-            ordinal_t size_to_read = ord - start_offset_in_this_page;
+            ordinal_t size_to_read = ord - 
_length_iterator->get_current_ordinal();
             bool has_null = false;
             ordinal_t item_ordinal = start_offset_in_this_page;
             while (size_to_read > 0) {
diff --git a/be/src/olap/rowset/segment_v2/segment_iterator.cpp 
b/be/src/olap/rowset/segment_v2/segment_iterator.cpp
index 6c342c6742..fce68258ba 100644
--- a/be/src/olap/rowset/segment_v2/segment_iterator.cpp
+++ b/be/src/olap/rowset/segment_v2/segment_iterator.cpp
@@ -463,6 +463,13 @@ void SegmentIterator::_init_lazy_materialization() {
         }
         
_opts.delete_condition_predicates->get_all_column_ids(predicate_columns);
 
+        // ARRAY column do not support lazy materialization read
+        for (auto cid : _schema.column_ids()) {
+            if (_schema.column(cid)->type() == OLAP_FIELD_TYPE_ARRAY) {
+                predicate_columns.insert(cid);
+            }
+        }
+
         // when all return columns have predicates, disable lazy 
materialization to avoid its overhead
         if (_schema.column_ids().size() > predicate_columns.size()) {
             _lazy_materialization_read = true;


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to