github-actions[bot] commented on code in PR #32180: URL: https://github.com/apache/doris/pull/32180#discussion_r1554818364
########## be/src/exprs/runtime_filter.cpp: ########## @@ -434,30 +439,33 @@ class RuntimePredicateWrapper { bitmaps.push_back(&(col->get_data()[i])); } } - _context.bitmap_filter_func->insert_many(bitmaps); + _context->bitmap_filter_func->insert_many(bitmaps); } RuntimeFilterType get_real_type() const { - auto real_filter_type = _filter_type; - if (real_filter_type == RuntimeFilterType::IN_OR_BLOOM_FILTER) { - real_filter_type = _is_bloomfilter ? RuntimeFilterType::BLOOM_FILTER - : RuntimeFilterType::IN_FILTER; + if (_filter_type == RuntimeFilterType::IN_OR_BLOOM_FILTER) { + if (_context->hybrid_set) { + return RuntimeFilterType::IN_FILTER; + } + return RuntimeFilterType::BLOOM_FILTER; } - return real_filter_type; + return _filter_type; } size_t get_bloom_filter_size() const { - if (_is_bloomfilter) { - return _context.bloom_filter_func->get_size(); - } - return 0; + return _context->bloom_filter_func ? _context->bloom_filter_func->get_size() : 0; } Status get_push_exprs(std::list<vectorized::VExprContextSPtr>& probe_ctxs, std::vector<vectorized::VRuntimeFilterPtr>& push_exprs, const TExpr& probe_expr); Status merge(const RuntimePredicateWrapper* wrapper) { Review Comment: warning: function 'merge' has cognitive complexity of 73 (threshold 50) [readability-function-cognitive-complexity] ```cpp Status merge(const RuntimePredicateWrapper* wrapper) { ^ ``` <details> <summary>Additional context</summary> **be/src/exprs/runtime_filter.cpp:463:** +1, including nesting penalty of 0, nesting level increased to 1 ```cpp if (is_ignored() || wrapper->is_ignored()) { ^ ``` **be/src/exprs/runtime_filter.cpp:463:** +1 ```cpp if (is_ignored() || wrapper->is_ignored()) { ^ ``` **be/src/exprs/runtime_filter.cpp:469:** +1 ```cpp _filter_type == RuntimeFilterType::IN_OR_BLOOM_FILTER && ^ ``` **be/src/exprs/runtime_filter.cpp:474:** +1 ```cpp bool can_not_merge_other = _filter_type != RuntimeFilterType::IN_OR_BLOOM_FILTER && ^ ``` **be/src/exprs/runtime_filter.cpp:477:** +1 ```cpp CHECK(!can_not_merge_in_or_bloom && !can_not_merge_other) ^ ``` **be/src/exprs/runtime_filter.cpp:482:** +1, including nesting penalty of 0, nesting level increased to 1 ```cpp switch (_filter_type) { ^ ``` **be/src/exprs/runtime_filter.cpp:486:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp if (_max_in_num >= 0 && _context->hybrid_set->size() >= _max_in_num) { ^ ``` **be/src/exprs/runtime_filter.cpp:496:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp RETURN_IF_ERROR(_context->minmax_func->merge(wrapper->_context->minmax_func.get())); ^ ``` **be/src/common/status.h:541:** expanded from macro 'RETURN_IF_ERROR' ```cpp do { \ ^ ``` **be/src/exprs/runtime_filter.cpp:496:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp RETURN_IF_ERROR(_context->minmax_func->merge(wrapper->_context->minmax_func.get())); ^ ``` **be/src/common/status.h:543:** expanded from macro 'RETURN_IF_ERROR' ```cpp if (UNLIKELY(!_status_.ok())) { \ ^ ``` **be/src/exprs/runtime_filter.cpp:500:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp RETURN_IF_ERROR( ^ ``` **be/src/common/status.h:541:** expanded from macro 'RETURN_IF_ERROR' ```cpp do { \ ^ ``` **be/src/exprs/runtime_filter.cpp:500:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp RETURN_IF_ERROR( ^ ``` **be/src/common/status.h:543:** expanded from macro 'RETURN_IF_ERROR' ```cpp if (UNLIKELY(!_status_.ok())) { \ ^ ``` **be/src/exprs/runtime_filter.cpp:508:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp if (other_filter_type == RuntimeFilterType::IN_OR_BLOOM_FILTER) { ^ ``` **be/src/exprs/runtime_filter.cpp:512:** +2, including nesting penalty of 1, nesting level increased to 2 ```cpp if (real_filter_type == RuntimeFilterType::IN_FILTER) { ^ ``` **be/src/exprs/runtime_filter.cpp:513:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp if (other_filter_type == RuntimeFilterType::IN_FILTER) { // in merge in ^ ``` **be/src/exprs/runtime_filter.cpp:515:** +4, including nesting penalty of 3, nesting level increased to 4 ```cpp if (_max_in_num >= 0 && _context->hybrid_set->size() >= _max_in_num) { ^ ``` **be/src/exprs/runtime_filter.cpp:519:** +5, including nesting penalty of 4, nesting level increased to 5 ```cpp RETURN_IF_ERROR(change_to_bloom_filter(true)); ^ ``` **be/src/common/status.h:541:** expanded from macro 'RETURN_IF_ERROR' ```cpp do { \ ^ ``` **be/src/exprs/runtime_filter.cpp:519:** +6, including nesting penalty of 5, nesting level increased to 6 ```cpp RETURN_IF_ERROR(change_to_bloom_filter(true)); ^ ``` **be/src/common/status.h:543:** expanded from macro 'RETURN_IF_ERROR' ```cpp if (UNLIKELY(!_status_.ok())) { \ ^ ``` **be/src/exprs/runtime_filter.cpp:521:** +1, nesting level increased to 3 ```cpp } else { ^ ``` **be/src/exprs/runtime_filter.cpp:524:** +4, including nesting penalty of 3, nesting level increased to 4 ```cpp RETURN_IF_ERROR(change_to_bloom_filter(false)); ^ ``` **be/src/common/status.h:541:** expanded from macro 'RETURN_IF_ERROR' ```cpp do { \ ^ ``` **be/src/exprs/runtime_filter.cpp:524:** +5, including nesting penalty of 4, nesting level increased to 5 ```cpp RETURN_IF_ERROR(change_to_bloom_filter(false)); ^ ``` **be/src/common/status.h:543:** expanded from macro 'RETURN_IF_ERROR' ```cpp if (UNLIKELY(!_status_.ok())) { \ ^ ``` **be/src/exprs/runtime_filter.cpp:525:** +4, including nesting penalty of 3, nesting level increased to 4 ```cpp RETURN_IF_ERROR(_context->bloom_filter_func->merge( ^ ``` **be/src/common/status.h:541:** expanded from macro 'RETURN_IF_ERROR' ```cpp do { \ ^ ``` **be/src/exprs/runtime_filter.cpp:525:** +5, including nesting penalty of 4, nesting level increased to 5 ```cpp RETURN_IF_ERROR(_context->bloom_filter_func->merge( ^ ``` **be/src/common/status.h:543:** expanded from macro 'RETURN_IF_ERROR' ```cpp if (UNLIKELY(!_status_.ok())) { \ ^ ``` **be/src/exprs/runtime_filter.cpp:528:** +1, nesting level increased to 2 ```cpp } else { ^ ``` **be/src/exprs/runtime_filter.cpp:529:** +3, including nesting penalty of 2, nesting level increased to 3 ```cpp if (other_filter_type == RuntimeFilterType::IN_FILTER) { // bloom filter merge in ^ ``` **be/src/exprs/runtime_filter.cpp:532:** +1, nesting level increased to 3 ```cpp } else { ^ ``` **be/src/exprs/runtime_filter.cpp:533:** +4, including nesting penalty of 3, nesting level increased to 4 ```cpp RETURN_IF_ERROR(_context->bloom_filter_func->merge( ^ ``` **be/src/common/status.h:541:** expanded from macro 'RETURN_IF_ERROR' ```cpp do { \ ^ ``` **be/src/exprs/runtime_filter.cpp:533:** +5, including nesting penalty of 4, nesting level increased to 5 ```cpp RETURN_IF_ERROR(_context->bloom_filter_func->merge( ^ ``` **be/src/common/status.h:543:** 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