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

zhangstar333 pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-2.0 by this push:
     new bbb1dc76e31 [cherry-pick](branch-20)fix the exchange not skip offset 
rows (#42190) (#42332)
bbb1dc76e31 is described below

commit bbb1dc76e312bdb8f75c826ae3654e0afdb4cd04
Author: zhangstar333 <[email protected]>
AuthorDate: Thu Oct 24 17:54:31 2024 +0800

    [cherry-pick](branch-20)fix the exchange not skip offset rows (#42190) 
(#42332)
    
    ## Proposed changes
    
    cherry-pick from master (#42190)
---
 be/src/vec/exec/vexchange_node.cpp | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/be/src/vec/exec/vexchange_node.cpp 
b/be/src/vec/exec/vexchange_node.cpp
index 6b40af8e946..01e06962a36 100644
--- a/be/src/vec/exec/vexchange_node.cpp
+++ b/be/src/vec/exec/vexchange_node.cpp
@@ -21,6 +21,8 @@
 #include <glog/logging.h>
 #include <opentelemetry/nostd/shared_ptr.h>
 
+#include <cstdint>
+
 #include "common/object_pool.h"
 #include "exec/rowid_fetcher.h"
 #include "exec/tablet_info.h"
@@ -113,9 +115,10 @@ Status VExchangeNode::get_next(RuntimeState* state, Block* 
block, bool* eos) {
                 _num_rows_skipped += block->rows();
                 block->set_num_rows(0);
             } else if (_num_rows_skipped < _offset) {
-                auto offset = _offset - _num_rows_skipped;
+                int64_t offset = _offset - _num_rows_skipped;
                 _num_rows_skipped = _offset;
-                block->set_num_rows(block->rows() - offset);
+                // should skip some rows
+                block->skip_num_rows(offset);
             }
         }
         if (_num_rows_returned + block->rows() < _limit) {


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

Reply via email to