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


##########
be/src/exec/exchange/local_exchanger.cpp:
##########
@@ -148,14 +149,20 @@ Status ShuffleExchanger::get_block(RuntimeState* state, 
Block* block, bool* eos,
     PartitionedBlock partitioned_block;
     MutableBlock mutable_block;
 
+    const auto max_batch_size = state->batch_size();
+    const auto max_block_bytes = state->preferred_block_size_bytes();
+
     auto get_data = [&]() -> Status {
         do {
             const auto* offset_start = 
partitioned_block.second.row_idxs->data() +
                                        partitioned_block.second.offset_start;
             auto block_wrapper = partitioned_block.first;
             
RETURN_IF_ERROR(mutable_block.add_rows(&block_wrapper->_data_block, 
offset_start,
                                                    offset_start + 
partitioned_block.second.length));
-        } while (mutable_block.rows() < state->batch_size() && !*eos &&
+            if (max_block_bytes > 0 && mutable_block.bytes() >= 
max_block_bytes) {

Review Comment:
   我感觉,我们一个统一的写法:
   1. 在operator 里放budget,把state 里的这两个变量放进去。
   2. 把estimated row bytes 这些都放到budget 里,这样统一维护所有的状态
   3. 其他地方如果想直接诶访问 这些状态,就从budget 里拿



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