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

airborne pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-2.0 by this push:
     new 13bd2bd61e7 [Fix](inverted index) fix missed array inverted index null 
bitmap #38907 (#38933)
13bd2bd61e7 is described below

commit 13bd2bd61e78b77f77d1b856c2eac2219678d6a8
Author: airborne12 <airborn...@gmail.com>
AuthorDate: Tue Aug 6 16:09:49 2024 +0800

    [Fix](inverted index) fix missed array inverted index null bitmap #38907 
(#38933)
    
    cherry pick from #38907
---
 be/src/olap/rowset/segment_v2/column_writer.cpp         | 9 +++++++++
 be/src/olap/rowset/segment_v2/inverted_index_writer.cpp | 4 ++++
 be/src/olap/rowset/segment_v2/inverted_index_writer.h   | 1 +
 3 files changed, 14 insertions(+)

diff --git a/be/src/olap/rowset/segment_v2/column_writer.cpp 
b/be/src/olap/rowset/segment_v2/column_writer.cpp
index 6f618cc1ddc..b26e123d973 100644
--- a/be/src/olap/rowset/segment_v2/column_writer.cpp
+++ b/be/src/olap/rowset/segment_v2/column_writer.cpp
@@ -507,6 +507,7 @@ Status ScalarColumnWriter::init() {
                         return Status::OK();
                     }
                     Status add_nulls(uint32_t count) override { return 
Status::OK(); }
+                    Status add_array_nulls(uint32_t row_id) override { return 
Status::OK(); }
                     Status finish() override { return Status::OK(); }
                     int64_t size() const override { return 0; }
                     int64_t file_size() const override { return 0; }
@@ -1019,10 +1020,18 @@ Status ArrayColumnWriter::append_nullable(const 
uint8_t* null_map, const uint8_t
                                           size_t num_rows) {
     RETURN_IF_ERROR(append_data(ptr, num_rows));
     if (is_nullable()) {
+        if (_opts.inverted_index) {
+            for (int row_id = 0; row_id < num_rows; row_id++) {
+                if (null_map[row_id] == 1) {
+                    
RETURN_IF_ERROR(_inverted_index_builder->add_array_nulls(row_id));
+                }
+            }
+        }
         RETURN_IF_ERROR(_null_writer->append_data(&null_map, num_rows));
     }
     return Status::OK();
 }
+
 Status ArrayColumnWriter::finish() {
     RETURN_IF_ERROR(_offset_writer->finish());
     if (is_nullable()) {
diff --git a/be/src/olap/rowset/segment_v2/inverted_index_writer.cpp 
b/be/src/olap/rowset/segment_v2/inverted_index_writer.cpp
index 7b9628c7c04..9b452b6c765 100644
--- a/be/src/olap/rowset/segment_v2/inverted_index_writer.cpp
+++ b/be/src/olap/rowset/segment_v2/inverted_index_writer.cpp
@@ -341,6 +341,10 @@ public:
         return Status::OK();
     }
 
+    Status add_array_nulls(uint32_t row_id) override {
+        _null_bitmap.add(row_id);
+        return Status::OK();
+    }
     void new_fulltext_field(const char* field_value_data, size_t 
field_value_size) {
         if (_parser_type == InvertedIndexParserType::PARSER_ENGLISH ||
             _parser_type == InvertedIndexParserType::PARSER_CHINESE ||
diff --git a/be/src/olap/rowset/segment_v2/inverted_index_writer.h 
b/be/src/olap/rowset/segment_v2/inverted_index_writer.h
index 44cc41789b5..87289a9eb40 100644
--- a/be/src/olap/rowset/segment_v2/inverted_index_writer.h
+++ b/be/src/olap/rowset/segment_v2/inverted_index_writer.h
@@ -53,6 +53,7 @@ public:
                                     size_t count) = 0;
 
     virtual Status add_nulls(uint32_t count) = 0;
+    virtual Status add_array_nulls(uint32_t row_id) = 0;
 
     virtual Status finish() = 0;
 


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

Reply via email to