github-actions[bot] commented on code in PR #41724: URL: https://github.com/apache/doris/pull/41724#discussion_r1797718914
########## be/src/pipeline/exec/spill_sort_source_operator.cpp: ########## @@ -86,11 +80,7 @@ Status SpillSortLocalState::initiate_merge_sort_spill_streams(RuntimeState* stat auto query_id = state->query_id(); - MonotonicStopWatch submit_timer; - submit_timer.start(); - - auto spill_func = [this, state, query_id, &parent, submit_timer] { - _spill_wait_in_queue_timer->update(submit_timer.elapsed_time()); + auto spill_func = [this, state, query_id, &parent] { Review Comment: warning: lambda has cognitive complexity of 52 (threshold 50) [readability-function-cognitive-complexity] ```cpp auto spill_func = [this, state, query_id, &parent] { ^ ``` <details> <summary>Additional context</summary> **be/src/pipeline/exec/spill_sort_source_operator.cpp:103:** +1, including nesting penalty of 0, nesting level increased to 1 ```cpp while (!state->is_cancelled()) { ^ ``` **be/src/pipeline/exec/spill_sort_source_operator.cpp:110:** nesting level increased to 2 ```cpp SCOPED_TIMER(Base::_spill_recover_time); ^ ``` **be/src/util/runtime_profile.h:67:** expanded from macro 'SCOPED_TIMER' ```cpp #define SCOPED_TIMER(c) ScopedTimer<MonotonicStopWatch> MACRO_CONCAT(SCOPED_TIMER, __COUNTER__)(c) ^ ``` **be/src/pipeline/exec/spill_sort_source_operator.cpp:115:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp RETURN_IF_ERROR(_status); ^ ``` **be/src/common/status.h:639:** expanded from macro 'RETURN_IF_ERROR' ```cpp do { \ ^ ``` **be/src/pipeline/exec/spill_sort_source_operator.cpp:115:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp RETURN_IF_ERROR(_status); ^ ``` **be/src/common/status.h:641:** expanded from macro 'RETURN_IF_ERROR' ```cpp if (UNLIKELY(!_status_.ok())) { \ ^ ``` **be/src/pipeline/exec/spill_sort_source_operator.cpp:118:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp if (_shared_state->sorted_streams.empty()) { ^ ``` **be/src/pipeline/exec/spill_sort_source_operator.cpp:127:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp RETURN_IF_ERROR(_status); ^ ``` **be/src/common/status.h:639:** expanded from macro 'RETURN_IF_ERROR' ```cpp do { \ ^ ``` **be/src/pipeline/exec/spill_sort_source_operator.cpp:127:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp RETURN_IF_ERROR(_status); ^ ``` **be/src/common/status.h:641:** expanded from macro 'RETURN_IF_ERROR' ```cpp if (UNLIKELY(!_status_.ok())) { \ ^ ``` **be/src/pipeline/exec/spill_sort_source_operator.cpp:133:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp while (!eos && !state->is_cancelled()) { ^ ``` **be/src/pipeline/exec/spill_sort_source_operator.cpp:133:** +1 ```cpp while (!eos && !state->is_cancelled()) { ^ ``` **be/src/pipeline/exec/spill_sort_source_operator.cpp:136:** nesting level increased to 3 ```cpp SCOPED_TIMER(Base::_spill_recover_time); ^ ``` **be/src/util/runtime_profile.h:67:** expanded from macro 'SCOPED_TIMER' ```cpp #define SCOPED_TIMER(c) ScopedTimer<MonotonicStopWatch> MACRO_CONCAT(SCOPED_TIMER, __COUNTER__)(c) ^ ``` **be/src/pipeline/exec/spill_sort_source_operator.cpp:137:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp DBUG_EXECUTE_IF("fault_inject::spill_sort_source::recover_spill_data", { ^ ``` **be/src/util/debug_points.h:36:** expanded from macro 'DBUG_EXECUTE_IF' ```cpp if (UNLIKELY(config::enable_debug_points)) { \ ^ ``` **be/src/pipeline/exec/spill_sort_source_operator.cpp:137:** +4, including nesting penalty of 3, nesting level increased to 4 ```cpp DBUG_EXECUTE_IF("fault_inject::spill_sort_source::recover_spill_data", { ^ ``` **be/src/util/debug_points.h:38:** expanded from macro 'DBUG_EXECUTE_IF' ```cpp if (dp) { \ ^ ``` **be/src/pipeline/exec/spill_sort_source_operator.cpp:142:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp if (_status.ok()) { ^ ``` **be/src/pipeline/exec/spill_sort_source_operator.cpp:146:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp RETURN_IF_ERROR(_status); ^ ``` **be/src/common/status.h:639:** expanded from macro 'RETURN_IF_ERROR' ```cpp do { \ ^ ``` **be/src/pipeline/exec/spill_sort_source_operator.cpp:146:** +4, including nesting penalty of 3, nesting level increased to 4 ```cpp RETURN_IF_ERROR(_status); ^ ``` **be/src/common/status.h:641:** expanded from macro 'RETURN_IF_ERROR' ```cpp if (UNLIKELY(!_status_.ok())) { \ ^ ``` **be/src/pipeline/exec/spill_sort_source_operator.cpp:148:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp if (_status.ok()) { ^ ``` **be/src/pipeline/exec/spill_sort_source_operator.cpp:149:** +4, including nesting penalty of 3, nesting level increased to 4 ```cpp DBUG_EXECUTE_IF("fault_inject::spill_sort_source::spill_merged_data", { ^ ``` **be/src/util/debug_points.h:36:** expanded from macro 'DBUG_EXECUTE_IF' ```cpp if (UNLIKELY(config::enable_debug_points)) { \ ^ ``` **be/src/pipeline/exec/spill_sort_source_operator.cpp:149:** +5, including nesting penalty of 4, nesting level increased to 5 ```cpp DBUG_EXECUTE_IF("fault_inject::spill_sort_source::spill_merged_data", { ^ ``` **be/src/util/debug_points.h:38:** expanded from macro 'DBUG_EXECUTE_IF' ```cpp if (dp) { \ ^ ``` **be/src/pipeline/exec/spill_sort_source_operator.cpp:155:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp RETURN_IF_ERROR(_status); ^ ``` **be/src/common/status.h:639:** expanded from macro 'RETURN_IF_ERROR' ```cpp do { \ ^ ``` **be/src/pipeline/exec/spill_sort_source_operator.cpp:155:** +4, including nesting penalty of 3, nesting level increased to 4 ```cpp RETURN_IF_ERROR(_status); ^ ``` **be/src/common/status.h:641:** expanded from macro 'RETURN_IF_ERROR' ```cpp if (UNLIKELY(!_status_.ok())) { \ ^ ``` </details> ########## be/src/pipeline/exec/partitioned_hash_join_probe_operator.cpp: ########## @@ -182,11 +176,7 @@ Status PartitionedHashJoinProbeLocalState::spill_probe_blocks( auto* spill_io_pool = ExecEnv::GetInstance()->spill_stream_mgr()->get_spill_io_thread_pool(); auto query_id = state->query_id(); - MonotonicStopWatch submit_timer; - submit_timer.start(); - - auto spill_func = [query_id, state, submit_timer, this] { - _spill_wait_in_queue_timer->update(submit_timer.elapsed_time()); + auto spill_func = [query_id, state, this] { Review Comment: warning: lambda has cognitive complexity of 56 (threshold 50) [readability-function-cognitive-complexity] ```cpp auto spill_func = [query_id, state, this] { ^ ``` <details> <summary>Additional context</summary> **be/src/pipeline/exec/partitioned_hash_join_probe_operator.cpp:183:** +1, including nesting penalty of 0, nesting level increased to 1 ```cpp for (uint32_t partition_index = 0; partition_index != p._partition_count; ^ ``` **be/src/pipeline/exec/partitioned_hash_join_probe_operator.cpp:187:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp if (partitioned_block) { ^ ``` **be/src/pipeline/exec/partitioned_hash_join_probe_operator.cpp:189:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp if (size >= vectorized::SpillStream::MIN_SPILL_WRITE_BATCH_MEM) { ^ ``` **be/src/pipeline/exec/partitioned_hash_join_probe_operator.cpp:192:** +1, nesting level increased to 3 ```cpp } else { ^ ``` **be/src/pipeline/exec/partitioned_hash_join_probe_operator.cpp:197:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp if (blocks.empty()) { ^ ``` **be/src/pipeline/exec/partitioned_hash_join_probe_operator.cpp:202:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp if (!spilling_stream) { ^ ``` **be/src/pipeline/exec/partitioned_hash_join_probe_operator.cpp:203:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp RETURN_IF_ERROR(ExecEnv::GetInstance()->spill_stream_mgr()->register_spill_stream( ^ ``` **be/src/common/status.h:639:** expanded from macro 'RETURN_IF_ERROR' ```cpp do { \ ^ ``` **be/src/pipeline/exec/partitioned_hash_join_probe_operator.cpp:203:** +4, including nesting penalty of 3, nesting level increased to 4 ```cpp RETURN_IF_ERROR(ExecEnv::GetInstance()->spill_stream_mgr()->register_spill_stream( ^ ``` **be/src/common/status.h:641:** expanded from macro 'RETURN_IF_ERROR' ```cpp if (UNLIKELY(!_status_.ok())) { \ ^ ``` **be/src/pipeline/exec/partitioned_hash_join_probe_operator.cpp:211:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp while (!blocks.empty() && !state->is_cancelled()) { ^ ``` **be/src/pipeline/exec/partitioned_hash_join_probe_operator.cpp:211:** +1 ```cpp while (!blocks.empty() && !state->is_cancelled()) { ^ ``` **be/src/pipeline/exec/partitioned_hash_join_probe_operator.cpp:215:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp RETURN_IF_ERROR(merged_block->merge(std::move(block))); ^ ``` **be/src/common/status.h:639:** expanded from macro 'RETURN_IF_ERROR' ```cpp do { \ ^ ``` **be/src/pipeline/exec/partitioned_hash_join_probe_operator.cpp:215:** +4, including nesting penalty of 3, nesting level increased to 4 ```cpp RETURN_IF_ERROR(merged_block->merge(std::move(block))); ^ ``` **be/src/common/status.h:641:** expanded from macro 'RETURN_IF_ERROR' ```cpp if (UNLIKELY(!_status_.ok())) { \ ^ ``` **be/src/pipeline/exec/partitioned_hash_join_probe_operator.cpp:216:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp DBUG_EXECUTE_IF("fault_inject::partitioned_hash_join_probe::spill_probe_blocks", { ^ ``` **be/src/util/debug_points.h:36:** expanded from macro 'DBUG_EXECUTE_IF' ```cpp if (UNLIKELY(config::enable_debug_points)) { \ ^ ``` **be/src/pipeline/exec/partitioned_hash_join_probe_operator.cpp:216:** +4, including nesting penalty of 3, nesting level increased to 4 ```cpp DBUG_EXECUTE_IF("fault_inject::partitioned_hash_join_probe::spill_probe_blocks", { ^ ``` **be/src/util/debug_points.h:38:** expanded from macro 'DBUG_EXECUTE_IF' ```cpp if (dp) { \ ^ ``` **be/src/pipeline/exec/partitioned_hash_join_probe_operator.cpp:221:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp if (merged_block->allocated_bytes() >= ^ ``` **be/src/pipeline/exec/partitioned_hash_join_probe_operator.cpp:224:** +4, including nesting penalty of 3, nesting level increased to 4 ```cpp RETURN_IF_ERROR( ^ ``` **be/src/common/status.h:639:** expanded from macro 'RETURN_IF_ERROR' ```cpp do { \ ^ ``` **be/src/pipeline/exec/partitioned_hash_join_probe_operator.cpp:224:** +5, including nesting penalty of 4, nesting level increased to 5 ```cpp RETURN_IF_ERROR( ^ ``` **be/src/common/status.h:641:** expanded from macro 'RETURN_IF_ERROR' ```cpp if (UNLIKELY(!_status_.ok())) { \ ^ ``` **be/src/pipeline/exec/partitioned_hash_join_probe_operator.cpp:230:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp if (!merged_block->empty()) { ^ ``` **be/src/pipeline/exec/partitioned_hash_join_probe_operator.cpp:232:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp RETURN_IF_ERROR( ^ ``` **be/src/common/status.h:639:** expanded from macro 'RETURN_IF_ERROR' ```cpp do { \ ^ ``` **be/src/pipeline/exec/partitioned_hash_join_probe_operator.cpp:232:** +4, including nesting penalty of 3, nesting level increased to 4 ```cpp RETURN_IF_ERROR( ^ ``` **be/src/common/status.h:641:** expanded from macro 'RETURN_IF_ERROR' ```cpp if (UNLIKELY(!_status_.ok())) { \ ^ ``` </details> -- 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