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


##########
be/src/runtime/buffer_control_block.cpp:
##########
@@ -119,8 +119,20 @@ Status 
BufferControlBlock::add_batch(std::unique_ptr<TFetchDataResult>& result)
     }
 
     if (_waiting_rpc.empty()) {
+        // Merge result into batch to reduce rpc times
+        if (!_batch_queue.empty() &&
+            ((_batch_queue.back()->result_batch.rows.size() + num_rows) < 
_buffer_limit) &&
+            !result->eos) {
+            std::vector<std::string>& back_rows = 
_batch_queue.back()->result_batch.rows;
+            std::vector<std::string>& result_rows = result->result_batch.rows;
+            auto back_size = back_rows.size();
+            back_rows.resize(back_size + num_rows);

Review Comment:
   should not resize



##########
be/src/runtime/buffer_control_block.cpp:
##########
@@ -119,8 +119,20 @@ Status 
BufferControlBlock::add_batch(std::unique_ptr<TFetchDataResult>& result)
     }
 
     if (_waiting_rpc.empty()) {
+        // Merge result into batch to reduce rpc times
+        if (!_batch_queue.empty() &&
+            ((_batch_queue.back()->result_batch.rows.size() + num_rows) < 
_buffer_limit) &&
+            !result->eos) {
+            std::vector<std::string>& back_rows = 
_batch_queue.back()->result_batch.rows;
+            std::vector<std::string>& result_rows = result->result_batch.rows;
+            auto back_size = back_rows.size();
+            back_rows.resize(back_size + num_rows);

Review Comment:
   should not resize



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