yiguolei commented on code in PR #62835:
URL: https://github.com/apache/doris/pull/62835#discussion_r3145261800


##########
be/src/storage/iterator/vcollect_iterator.cpp:
##########
@@ -488,10 +495,56 @@ Status VCollectIterator::_topn_next(Block* block) {
                << " mutable_block.rows()=" << mutable_block.rows();
     *block = mutable_block.to_block();
 
+    // If byte budget is active and the result exceeds it, split into chunks.
+    size_t preferred_bytes = _reader->preferred_block_size_bytes();
+    if (preferred_bytes > 0 && block->rows() > 1 && block->bytes() > 
preferred_bytes) {
+        _topn_result_block = std::move(*block);
+        _topn_result_offset = 0;
+        return _topn_next_chunk(block);
+    }
+
     _topn_eof = true;
     return block->rows() > 0 ? Status::OK() : Status::Error<END_OF_FILE>("");
 }
 
+Status VCollectIterator::_topn_next_chunk(Block* block) {
+    size_t total_rows = _topn_result_block.rows();

Review Comment:
   1. queue  blocks--- memory
   2. generate big block



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