You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "zhannngchen (via GitHub)" <gi...@apache.org> on 2023/08/10 06:38:33 UTC

[GitHub] [doris] zhannngchen commented on a diff in pull request #22782: [Fix](Partial update) Fix wrong position using in segment writer

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


##########
be/src/olap/rowset/segment_v2/segment_writer.cpp:
##########
@@ -388,10 +388,17 @@ Status SegmentWriter::append_block_with_partial_content(const vectorized::Block*
     // locate rows in base data
 
     int64_t num_rows_filtered = 0;
-    for (size_t pos = row_pos; pos < row_pos + num_rows; pos++) {
-        std::string key = _full_encode_keys(key_columns, pos);
+    for (size_t block_pos = row_pos; block_pos < row_pos + num_rows; block_pos++) {
+        // block   segment
+        //   2   ->   0
+        //   3   ->   1
+        //   4   ->   2
+        //   5   ->   3
+        // here row_pos = 2, num_rows = 4.
+        size_t segment_pos = block_pos - row_pos;

Review Comment:
   It's not the real rowid in segment, if you append multiple block to the segment



-- 
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-unsubscribe@doris.apache.org

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


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