luozenglin commented on code in PR #10533: URL: https://github.com/apache/doris/pull/10533#discussion_r912332779
########## be/src/runtime/plan_fragment_executor.cpp: ########## @@ -262,30 +270,36 @@ Status PlanFragmentExecutor::open_vectorized_internal() { RETURN_IF_ERROR(_sink->open(runtime_state())); } - while (true) { - doris::vectorized::Block* block; + { + telemetry::SpanGuard sink_send_span_guard {}; + while (true) { + doris::vectorized::Block* block; - { - SCOPED_CPU_TIMER(_fragment_cpu_timer); - RETURN_IF_ERROR(get_vectorized_internal(&block)); - } + { + SCOPED_CPU_TIMER(_fragment_cpu_timer); + RETURN_IF_ERROR(get_vectorized_internal(&block)); + } - if (block == NULL) { - break; - } + if (block == NULL) { + break; + } - SCOPED_TIMER(profile()->total_time_counter()); - SCOPED_CPU_TIMER(_fragment_cpu_timer); - // Collect this plan and sub plan statistics, and send to parent plan. - if (_collect_query_statistics_with_every_batch) { - _collect_query_statistics(); - } + SCOPED_TIMER(profile()->total_time_counter()); + SCOPED_CPU_TIMER(_fragment_cpu_timer); + // Collect this plan and sub plan statistics, and send to parent plan. + if (_collect_query_statistics_with_every_batch) { + _collect_query_statistics(); + } - auto st = _sink->send(runtime_state(), block); - if (st.is_end_of_file()) { - break; + auto st = _sink->send(runtime_state(), block); + if (UNLIKELY(!sink_send_span_guard.has_span())) { + sink_send_span_guard.set_span(_sink->get_send_span()); Review Comment: The `_send_span` overrides the first to last call to `send`, and I've changed the `sink_send_span_guard` to a more concise code. -- 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