github-actions[bot] commented on code in PR #31067:
URL: https://github.com/apache/doris/pull/31067#discussion_r1497358196
##########
be/src/exprs/runtime_filter.cpp:
##########
@@ -954,47 +954,53 @@ void IRuntimeFilter::insert_batch(const
vectorized::ColumnPtr column, size_t sta
_wrapper->insert_batch(column, start);
}
-Status IRuntimeFilter::merge_local_filter(RuntimePredicateWrapper* wrapper,
int* merged_num) {
- SCOPED_TIMER(_merge_local_rf_timer);
- std::unique_lock lock(_local_merge_mutex);
- if (_merged_rf_num == 0) {
- _wrapper = wrapper;
- } else {
- RETURN_IF_ERROR(merge_from(wrapper));
- }
- *merged_num = ++_merged_rf_num;
- return Status::OK();
-}
-
Status IRuntimeFilter::publish(bool publish_local) {
Review Comment:
warning: function 'publish' has cognitive complexity of 77 (threshold 50)
[readability-function-cognitive-complexity]
```cpp
Status IRuntimeFilter::publish(bool publish_local) {
^
```
<details>
<summary>Additional context</summary>
**be/src/exprs/runtime_filter.cpp:958:** nesting level increased to 1
```cpp
auto send_to_remote = [&](IRuntimeFilter* filter) {
^
```
**be/src/exprs/runtime_filter.cpp:961:** +2, including nesting penalty of 1,
nesting level increased to 2
```cpp
RETURN_IF_ERROR(_state->runtime_filter_mgr->get_merge_addr(&addr));
^
```
**be/src/common/status.h:541:** expanded from macro 'RETURN_IF_ERROR'
```cpp
do { \
^
```
**be/src/exprs/runtime_filter.cpp:961:** +3, including nesting penalty of 2,
nesting level increased to 3
```cpp
RETURN_IF_ERROR(_state->runtime_filter_mgr->get_merge_addr(&addr));
^
```
**be/src/common/status.h:543:** expanded from macro 'RETURN_IF_ERROR'
```cpp
if (UNLIKELY(!_status_.ok())) { \
^
```
**be/src/exprs/runtime_filter.cpp:964:** nesting level increased to 1
```cpp
auto send_to_local = [&](RuntimePredicateWrapper* wrapper) {
^
```
**be/src/exprs/runtime_filter.cpp:966:** +2, including nesting penalty of 1,
nesting level increased to 2
```cpp
RETURN_IF_ERROR(_state->runtime_filter_mgr->get_consume_filters(_filter_id,
filters));
^
```
**be/src/common/status.h:541:** expanded from macro 'RETURN_IF_ERROR'
```cpp
do { \
^
```
**be/src/exprs/runtime_filter.cpp:966:** +3, including nesting penalty of 2,
nesting level increased to 3
```cpp
RETURN_IF_ERROR(_state->runtime_filter_mgr->get_consume_filters(_filter_id,
filters));
^
```
**be/src/common/status.h:543:** expanded from macro 'RETURN_IF_ERROR'
```cpp
if (UNLIKELY(!_status_.ok())) { \
^
```
**be/src/exprs/runtime_filter.cpp:976:** nesting level increased to 1
```cpp
auto do_local_merge = [&]() {
^
```
**be/src/exprs/runtime_filter.cpp:978:** +2, including nesting penalty of 1,
nesting level increased to 2
```cpp
RETURN_IF_ERROR(_state->runtime_filter_mgr->get_local_merge_producer_filters(
^
```
**be/src/common/status.h:541:** expanded from macro 'RETURN_IF_ERROR'
```cpp
do { \
^
```
**be/src/exprs/runtime_filter.cpp:978:** +3, including nesting penalty of 2,
nesting level increased to 3
```cpp
RETURN_IF_ERROR(_state->runtime_filter_mgr->get_local_merge_producer_filters(
^
```
**be/src/common/status.h:543:** expanded from macro 'RETURN_IF_ERROR'
```cpp
if (UNLIKELY(!_status_.ok())) { \
^
```
**be/src/exprs/runtime_filter.cpp:981:** +2, including nesting penalty of 1,
nesting level increased to 2
```cpp
RETURN_IF_ERROR(local_merge_filters->filters[0]->merge_from(_wrapper));
^
```
**be/src/common/status.h:541:** expanded from macro 'RETURN_IF_ERROR'
```cpp
do { \
^
```
**be/src/exprs/runtime_filter.cpp:981:** +3, including nesting penalty of 2,
nesting level increased to 3
```cpp
RETURN_IF_ERROR(local_merge_filters->filters[0]->merge_from(_wrapper));
^
```
**be/src/common/status.h:543:** expanded from macro 'RETURN_IF_ERROR'
```cpp
if (UNLIKELY(!_status_.ok())) { \
^
```
**be/src/exprs/runtime_filter.cpp:983:** +2, including nesting penalty of 1,
nesting level increased to 2
```cpp
if (local_merge_filters->merge_time == 0) {
^
```
**be/src/exprs/runtime_filter.cpp:984:** +3, including nesting penalty of 2,
nesting level increased to 3
```cpp
if (_has_local_target) {
^
```
**be/src/exprs/runtime_filter.cpp:985:** +4, including nesting penalty of 3,
nesting level increased to 4
```cpp
RETURN_IF_ERROR(send_to_local(local_merge_filters->filters[0]->_wrapper));
^
```
**be/src/common/status.h:541:** expanded from macro 'RETURN_IF_ERROR'
```cpp
do { \
^
```
**be/src/exprs/runtime_filter.cpp:985:** +5, including nesting penalty of 4,
nesting level increased to 5
```cpp
RETURN_IF_ERROR(send_to_local(local_merge_filters->filters[0]->_wrapper));
^
```
**be/src/common/status.h:543:** expanded from macro 'RETURN_IF_ERROR'
```cpp
if (UNLIKELY(!_status_.ok())) { \
^
```
**be/src/exprs/runtime_filter.cpp:986:** +1, nesting level increased to 3
```cpp
} else {
^
```
**be/src/exprs/runtime_filter.cpp:987:** +4, including nesting penalty of 3,
nesting level increased to 4
```cpp
RETURN_IF_ERROR(send_to_remote(local_merge_filters->filters[0]));
^
```
**be/src/common/status.h:541:** expanded from macro 'RETURN_IF_ERROR'
```cpp
do { \
^
```
**be/src/exprs/runtime_filter.cpp:987:** +5, including nesting penalty of 4,
nesting level increased to 5
```cpp
RETURN_IF_ERROR(send_to_remote(local_merge_filters->filters[0]));
^
```
**be/src/common/status.h:543:** expanded from macro 'RETURN_IF_ERROR'
```cpp
if (UNLIKELY(!_status_.ok())) { \
^
```
**be/src/exprs/runtime_filter.cpp:993:** +1, including nesting penalty of 0,
nesting level increased to 1
```cpp
if (_need_local_merge && _has_local_target) {
^
```
**be/src/exprs/runtime_filter.cpp:993:** +1
```cpp
if (_need_local_merge && _has_local_target) {
^
```
**be/src/exprs/runtime_filter.cpp:994:** +2, including nesting penalty of 1,
nesting level increased to 2
```cpp
RETURN_IF_ERROR(do_local_merge());
^
```
**be/src/common/status.h:541:** expanded from macro 'RETURN_IF_ERROR'
```cpp
do { \
^
```
**be/src/exprs/runtime_filter.cpp:994:** +3, including nesting penalty of 2,
nesting level increased to 3
```cpp
RETURN_IF_ERROR(do_local_merge());
^
```
**be/src/common/status.h:543:** expanded from macro 'RETURN_IF_ERROR'
```cpp
if (UNLIKELY(!_status_.ok())) { \
^
```
**be/src/exprs/runtime_filter.cpp:995:** +1, nesting level increased to 1
```cpp
} else if (_has_local_target) {
^
```
**be/src/exprs/runtime_filter.cpp:996:** +2, including nesting penalty of 1,
nesting level increased to 2
```cpp
RETURN_IF_ERROR(send_to_local(_wrapper));
^
```
**be/src/common/status.h:541:** expanded from macro 'RETURN_IF_ERROR'
```cpp
do { \
^
```
**be/src/exprs/runtime_filter.cpp:996:** +3, including nesting penalty of 2,
nesting level increased to 3
```cpp
RETURN_IF_ERROR(send_to_local(_wrapper));
^
```
**be/src/common/status.h:543:** expanded from macro 'RETURN_IF_ERROR'
```cpp
if (UNLIKELY(!_status_.ok())) { \
^
```
**be/src/exprs/runtime_filter.cpp:997:** +1, nesting level increased to 1
```cpp
} else if (!publish_local) {
^
```
**be/src/exprs/runtime_filter.cpp:998:** +2, including nesting penalty of 1,
nesting level increased to 2
```cpp
if (_is_broadcast_join || _state->be_exec_version < 3) {
^
```
**be/src/exprs/runtime_filter.cpp:998:** +1
```cpp
if (_is_broadcast_join || _state->be_exec_version < 3) {
^
```
**be/src/exprs/runtime_filter.cpp:999:** +3, including nesting penalty of 2,
nesting level increased to 3
```cpp
RETURN_IF_ERROR(send_to_remote(this));
^
```
**be/src/common/status.h:541:** expanded from macro 'RETURN_IF_ERROR'
```cpp
do { \
^
```
**be/src/exprs/runtime_filter.cpp:999:** +4, including nesting penalty of 3,
nesting level increased to 4
```cpp
RETURN_IF_ERROR(send_to_remote(this));
^
```
**be/src/common/status.h:543:** expanded from macro 'RETURN_IF_ERROR'
```cpp
if (UNLIKELY(!_status_.ok())) { \
^
```
**be/src/exprs/runtime_filter.cpp:1000:** +1, nesting level increased to 2
```cpp
} else {
^
```
**be/src/exprs/runtime_filter.cpp:1001:** +3, including nesting penalty of
2, nesting level increased to 3
```cpp
RETURN_IF_ERROR(do_local_merge());
^
```
**be/src/common/status.h:541:** expanded from macro 'RETURN_IF_ERROR'
```cpp
do { \
^
```
**be/src/exprs/runtime_filter.cpp:1001:** +4, including nesting penalty of
3, nesting level increased to 4
```cpp
RETURN_IF_ERROR(do_local_merge());
^
```
**be/src/common/status.h:543:** expanded from macro 'RETURN_IF_ERROR'
```cpp
if (UNLIKELY(!_status_.ok())) { \
^
```
**be/src/exprs/runtime_filter.cpp:1003:** +1, nesting level increased to 1
```cpp
} else {
^
```
</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: [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]