luozenglin commented on code in PR #10533:
URL: https://github.com/apache/doris/pull/10533#discussion_r912311732
##########
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:
Because the _send_span in _sink is assigned at the first call to
_sink->send. Maybe I can change the code to make sink_send_span_guard set span
outside of the while loop to reduce this branch judgment.
--
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]