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

yiguolei pushed a commit to branch 2.1-tmp
in repository https://gitbox.apache.org/repos/asf/doris.git

commit 7fae123b01f74777fa6446514c98ebb47b164dab
Author: amory <[email protected]>
AuthorDate: Wed Apr 3 20:04:59 2024 +0800

    [FIX](inverted_index) fix inverted index write array with _doc is empty 
(#33170)
---
 be/src/clucene                                          | 2 +-
 be/src/olap/rowset/segment_v2/inverted_index_writer.cpp | 9 ++++++---
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/be/src/clucene b/be/src/clucene
index ff2cd82f9e5..9f849a47f70 160000
--- a/be/src/clucene
+++ b/be/src/clucene
@@ -1 +1 @@
-Subproject commit ff2cd82f9e545a24318f1256eba312b4d0562a82
+Subproject commit 9f849a47f70625a57fedbaa1f5a6f89bc8f32967
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 fe1c0c4f9ac..641eaf2b886 100644
--- a/be/src/olap/rowset/segment_v2/inverted_index_writer.cpp
+++ b/be/src/olap/rowset/segment_v2/inverted_index_writer.cpp
@@ -401,9 +401,12 @@ public:
                         _doc->add(*new_field);
                     }
                 }
-                RETURN_IF_ERROR(add_document());
-                _doc->clear();
-                _CLDELETE(ts);
+                if (!_doc->getFields()->empty()) {
+                    // if this array is null, we just ignore to write inverted 
index
+                    RETURN_IF_ERROR(add_document());
+                    _doc->clear();
+                    _CLDELETE(ts);
+                }
                 _rid++;
             }
         } else if constexpr (field_is_numeric_type(field_type)) {


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

Reply via email to