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


##########
be/src/olap/rowset/segment_v2/segment_writer.cpp:
##########
@@ -638,6 +648,27 @@ Status SegmentWriter::append_block(const 
vectorized::Block* block, size_t row_po
         _serialize_block_to_row_column(*const_cast<vectorized::Block*>(block));
     }
 
+    if (_opts.write_type == DataWriteType::TYPE_DIRECT && 
_opts.enable_unique_key_merge_on_write &&
+        !_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;

Review Comment:
   seg_pos should not start from 0, should be 
`_column_writers[_tablet_schema->delete_sign_idx()].get_next_rowid()`?



-- 
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