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

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

commit b136846c0d4c43f9c8634ad68f9f2c3cca546cc3
Author: bobhan1 <bh2444151...@outlook.com>
AuthorDate: Sat Sep 2 14:28:59 2023 +0800

    [Fix](IndexColumnWriter) Add logic for IndexedColumnWriter::add when the 
current page is full (#23766)
---
 be/src/olap/rowset/segment_v2/indexed_column_writer.cpp | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/be/src/olap/rowset/segment_v2/indexed_column_writer.cpp 
b/be/src/olap/rowset/segment_v2/indexed_column_writer.cpp
index 28a44b7b75..06c90ff6ab 100644
--- a/be/src/olap/rowset/segment_v2/indexed_column_writer.cpp
+++ b/be/src/olap/rowset/segment_v2/indexed_column_writer.cpp
@@ -89,6 +89,15 @@ Status IndexedColumnWriter::add(const void* value) {
     size_t num_to_write = 1;
     RETURN_IF_ERROR(
             _data_page_builder->add(reinterpret_cast<const uint8_t*>(value), 
&num_to_write));
+    CHECK(num_to_write == 1 || num_to_write == 0);
+    if (num_to_write == 0) {
+        CHECK(_data_page_builder->is_page_full());
+        // current page is already full, we need to first flush the current 
page,
+        // and then add the value to the new page
+        size_t num_val;
+        RETURN_IF_ERROR(_finish_current_data_page(num_val));
+        return add(value);
+    }
     _num_values++;
     size_t num_val;
     if (_data_page_builder->is_page_full()) {


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

Reply via email to