github-actions[bot] commented on code in PR #70416:
URL: https://github.com/apache/doris/pull/70416#discussion_r4545753152


##########
be/src/storage/segment/variant/sparse_column_merge_iterator.cpp:
##########
@@ -157,6 +161,12 @@ void 
SparseColumnMergeIterator::_merge_to(MutableColumnPtr& dst) {
                                                  dst_sparse_column_values, 
src_path, row);
         }
 
+        // The interleaving above assumes the source sparse cells and the 
materialized subcolumns
+        // are byte-ordered. Assert the merged row keeps that invariant for 
downstream readers;
+        // debug-only, so release compaction pays nothing.
+        DCHECK(is_variant_sparse_row_sorted(dst_sparse_column_paths,
+                                            
dst_sparse_column_offsets[ssize_t(row) - 1],

Review Comment:
   [P2] Limit the destination assertion to the row just appended
   
   `row` restarts at zero for each source batch, but `_merge_to` appends to 
`dst`. `SegmentIterator::_read_columns_by_index` can call this iterator 
repeatedly on the same destination for 256-row chunks of discontinuous row IDs, 
for example after delete-bitmap filtering. On the second call, `row == 0` makes 
this start offset `dst_sparse_column_offsets[-1] == 0`, so valid rows 
containing `z` followed by a new row containing `a` are checked as one sequence 
and abort a debug/ASAN BE. Capture the destination key count before appending 
each row (or use its actual last offset) and check only that row's range; add 
coverage that appends a second batch to a nonempty destination.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to