You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by mo...@apache.org on 2023/01/08 01:41:18 UTC

[doris] 02/03: [fix](index) fix wrong dcheck in indexed column writer (#15520)

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

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

commit 558cfdac85a0cb2a24fcb9a40dff95e85034beef
Author: Xin Liao <li...@126.com>
AuthorDate: Fri Dec 30 20:12:41 2022 +0800

    [fix](index) fix wrong dcheck in indexed column writer (#15520)
---
 be/src/olap/rowset/segment_v2/indexed_column_writer.cpp | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

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 c15fe36429..9f7202e8c8 100644
--- a/be/src/olap/rowset/segment_v2/indexed_column_writer.cpp
+++ b/be/src/olap/rowset/segment_v2/indexed_column_writer.cpp
@@ -149,8 +149,11 @@ Status IndexedColumnWriter::finish(IndexedColumnMetaPB* meta) {
     meta->set_encoding(_options.encoding);
     meta->set_num_values(_num_values);
     meta->set_compression(_options.compression);
-    if (_num_data_pages <= 1) {
-        DCHECK(num_val_in_page == _num_values);
+    // `_finish_current_data_page` will be called in `add` function when page is full,
+    // so num_val_in_page will be zero in this case.
+    if (_num_data_pages <= 1 && num_val_in_page != 0) {
+        DCHECK(num_val_in_page == _num_values)
+                << "num_val_in_page: " << num_val_in_page << ", _num_values: " << _num_values;
     }
     return Status::OK();
 }


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