xinyiZzz commented on code in PR #43281:
URL: https://github.com/apache/doris/pull/43281#discussion_r1835597583


##########
be/src/vec/sink/varrow_flight_result_writer.cpp:
##########
@@ -67,29 +60,31 @@ Status VArrowFlightResultWriter::write(RuntimeState* state, 
Block& input_block)
     
RETURN_IF_ERROR(VExprContext::get_output_block_after_execute_exprs(_output_vexpr_ctxs,
                                                                        
input_block, &block));
 
-    // convert one batch
-    std::shared_ptr<arrow::RecordBatch> result;
-    auto num_rows = block.rows();
-    // arrow::RecordBatch without `nbytes()` in C++
-    uint64_t bytes_sent = block.bytes();
     {
-        SCOPED_TIMER(_convert_tuple_timer);
-        RETURN_IF_ERROR(convert_to_arrow_batch(block, _arrow_schema, 
arrow::default_memory_pool(),
-                                               &result, _timezone_obj));
-    }
-    {
-        SCOPED_TIMER(_result_send_timer);
-        // If this is a dry run task, no need to send data block
-        if (!_is_dry_run) {
-            status = _sinker->add_arrow_batch(state, result);
-        }
-        if (status.ok()) {
-            _written_rows += num_rows;
+        SCOPED_SWITCH_THREAD_MEM_TRACKER_LIMITER(_sinker->mem_tracker());

Review Comment:
   因为会拷贝一份Block放入 buffer control block 的 result queue 里,这个新 Block  的生命周期不属于 
query,属于 buffer control block,会在 fetch queue 时释放
   
   所以这里 swtich 了 buffer control block 的 mem tracker



##########
gensrc/proto/internal_service.proto:
##########
@@ -283,6 +283,21 @@ message PFetchDataResult {
     optional bool empty_batch = 6;
 };
 
+message PFetchArrowDataRequest {
+    optional PUniqueId finst_id = 1;
+};
+
+message PFetchArrowDataResult {
+    required PStatus status = 1;

Review Comment:
   done



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