diff --git a/be/src/olap/rowset/vertical_beta_rowset_writer.cpp b/be/src/olap/rowset/vertical_beta_rowset_writer.cpp index 942ced616fcaae..e0c1b65059fd05 100644 --- a/be/src/olap/rowset/vertical_beta_rowset_writer.cpp +++ b/be/src/olap/rowset/vertical_beta_rowset_writer.cpp @@ -89,7 +89,7 @@ Status VerticalBetaRowsetWriter::add_columns(const vectorized::Block* block, VLOG_NOTICE << "num_rows_written: " << num_rows_written << ", _cur_writer_idx: " << _cur_writer_idx; uint32_t num_rows_key_group = _segment_writers[_cur_writer_idx]->row_count(); - CHECK_LE(num_rows_written, num_rows_key_group); + CHECK_LT(num_rows_written, num_rows_key_group); // init if it's first value column write in current segment if (num_rows_written == 0) { VLOG_NOTICE << "init first value column segment writer"; @@ -104,7 +104,8 @@ Status VerticalBetaRowsetWriter::add_columns(const vectorized::Block* block, left -= to_write; CHECK_GE(left, 0); - if (left > 0) { + if (num_rows_key_group == num_rows_written + to_write && + _cur_writer_idx < _segment_writers.size() - 1) { ++_cur_writer_idx; } }