yixiutt commented on code in PR #12214:
URL: https://github.com/apache/doris/pull/12214#discussion_r959543223


##########
be/src/vec/olap/vgeneric_iterators.cpp:
##########
@@ -382,21 +399,36 @@ Status VMergeIterator::next_batch(vectorized::Block* 
block) {
         _block_row_locations.resize(block_row_max);
     }
     size_t row_idx = 0;
+    VMergeIteratorContext* pre_ctx = nullptr;
     while (block->rows() < block_row_max) {
         if (_merge_heap.empty()) break;
 
         auto ctx = _merge_heap.top();
         _merge_heap.pop();
 
         if (!ctx->need_skip()) {
-            // copy current row to block
-            ctx->copy_row(block);
+            ctx->add_cur_batch();
+            if (pre_ctx != ctx) {
+                if (pre_ctx) {

Review Comment:
   add a row_idx check below



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