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

Mryange 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 a0b7b0d9d3c [fix](sort) Preserve large offsets in sorted run merging 
(#71302)
a0b7b0d9d3c is described below

commit a0b7b0d9d3cb1af3c96650a995d57c52f94a2e91
Author: Mryange <[email protected]>
AuthorDate: Thu Dec 3 14:51:42 2026 +0800

    [fix](sort) Preserve large offsets in sorted run merging (#71302)
    
    A large OFFSET could stall a single-run merge because the remaining
    offset was cast to a 32-bit integer. This change computes the skip count
    in size_t, bounded by the rows remaining in the current block.
    
    Verified on an ASAN BE build that the reported query finishes and
    returns the expected rows.
---
 be/src/exec/sort/vsorted_run_merger.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/be/src/exec/sort/vsorted_run_merger.cpp 
b/be/src/exec/sort/vsorted_run_merger.cpp
index 353fb949656..bdd918fe825 100644
--- a/be/src/exec/sort/vsorted_run_merger.cpp
+++ b/be/src/exec/sort/vsorted_run_merger.cpp
@@ -126,7 +126,7 @@ Status VSortedRunMerger::get_next(Block* output_block, 
bool* eos) {
         DCHECK(!current->eof());
         DCHECK(current->block_ptr() != nullptr);
         while (_offset != 0) {
-            auto process_rows = std::min(current->rows - current->pos, 
(int)_offset);
+            auto process_rows = std::min<size_t>(current->rows - current->pos, 
_offset);
             current->next(process_rows);
             _offset -= process_rows;
             if (current->is_last(0)) {


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

Reply via email to