HappenLee commented on code in PR #45952:
URL: https://github.com/apache/doris/pull/45952#discussion_r1900391926


##########
be/src/vec/common/sort/sorter.cpp:
##########
@@ -90,53 +90,48 @@ Status 
MergeSorterState::merge_sort_read(doris::vectorized::Block* block, int ba
                                          bool* eos) {
     DCHECK(sorted_blocks_.empty());
     DCHECK(unsorted_block_->empty());
-    if (priority_queue_.empty()) {
-        *eos = true;
-    } else if (priority_queue_.size() == 1) {
-        if (offset_ != 0 || priority_queue_.top()->pos != 0) {
-            // Skip rows already returned or need to be ignored
-            int64_t offset = offset_ + (int64_t)priority_queue_.top()->pos;
-            priority_queue_.top().impl->block->skip_num_rows(offset);
-        }
-        block->swap(*priority_queue_.top().impl->block);
-        *eos = true;
-    } else {
-        RETURN_IF_ERROR(_merge_sort_read_impl(batch_size, block, eos));
-    }
+    RETURN_IF_ERROR(_merge_sort_read_impl(batch_size, block, eos));

Review Comment:
   `priority_queue_.size() == 1` reduce the mem copy, but  after change here 
need another copy work



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