zhannngchen commented on code in PR #24011:
URL: https://github.com/apache/doris/pull/24011#discussion_r1318334768


##########
be/src/olap/rowset/segment_v2/segment_writer.cpp:
##########
@@ -638,6 +644,26 @@ Status SegmentWriter::append_block(const 
vectorized::Block* block, size_t row_po
         _serialize_block_to_row_column(*const_cast<vectorized::Block*>(block));
     }
 
+    if (!_tablet_schema->has_sequence_col() && 
_tablet_schema->delete_sign_idx() != -1) {
+        const vectorized::ColumnWithTypeAndName& delete_sign_column =
+                block->get_by_position(_tablet_schema->delete_sign_idx());
+        auto& delete_sign_col =
+                reinterpret_cast<const 
vectorized::ColumnInt8&>(*(delete_sign_column.column));
+        if (delete_sign_col.size() >= row_pos + num_rows) {
+            const vectorized::Int8* delete_sign_column_data = 
delete_sign_col.get_data().data();
+            for (size_t block_pos = row_pos, seg_pos = 0; seg_pos < num_rows;
+                 block_pos++, seg_pos++) {
+                // we can directly use delete bitmap to mark the rows with 
delete sign as deleted
+                // if sequence column doesn't exist to eliminate reading 
delete sign columns in later reads
+                if (delete_sign_column_data[block_pos]) {
+                    // the version here is meaningless
+                    
_mow_context->delete_bitmap->add({_opts.rowset_ctx->rowset_id, _segment_id, 1},

Review Comment:
   Define version 0 and 1 as const variable, give them some meaningful name



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to