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

zhangchen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 2638ad0550 [fix](compaction) rowid_conversion should ignore deleted 
row on normal compaction (#24005)
2638ad0550 is described below

commit 2638ad055099057178e9c3f5fd1837e644ab1a26
Author: huanghaibin <284824...@qq.com>
AuthorDate: Fri Sep 8 19:44:24 2023 +0800

    [fix](compaction) rowid_conversion should ignore deleted row on normal 
compaction (#24005)
---
 be/src/vec/olap/block_reader.cpp | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/be/src/vec/olap/block_reader.cpp b/be/src/vec/olap/block_reader.cpp
index 2342c9faf9..b7a640ab4a 100644
--- a/be/src/vec/olap/block_reader.cpp
+++ b/be/src/vec/olap/block_reader.cpp
@@ -377,8 +377,16 @@ Status BlockReader::_unique_key_next_block(Block* block, 
bool* eof) {
                 
reinterpret_cast<ColumnInt8*>(target_columns[delete_sign_idx].get())
                         ->get_data()
                         .data();
+        int delete_count = 0;
         for (int i = 0; i < target_block_row; ++i) {
-            filter_data[i] = delete_data[i] == 0;
+            bool sign = (delete_data[i] == 0);
+            filter_data[i] = sign;
+            if (UNLIKELY(!sign)) {
+                if (UNLIKELY(_reader_context.record_rowids)) {
+                    _block_row_locations[i].row_id = -1;
+                    delete_count++;
+                }
+            }
         }
 
         ColumnWithTypeAndName column_with_type_and_name {_delete_filter_column,
@@ -388,6 +396,9 @@ Status BlockReader::_unique_key_next_block(Block* block, 
bool* eof) {
         RETURN_IF_ERROR(Block::filter_block(block, target_columns.size(), 
target_columns.size()));
         _stats.rows_del_filtered += target_block_row - block->rows();
         DCHECK(block->try_get_by_name("__DORIS_COMPACTION_FILTER__") == 
nullptr);
+        if (UNLIKELY(_reader_context.record_rowids)) {
+            DCHECK_EQ(_block_row_locations.size(), block->rows() + 
delete_count);
+        }
     }
     return Status::OK();
 }


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

Reply via email to