github-actions[bot] commented on code in PR #38300: URL: https://github.com/apache/doris/pull/38300#discussion_r1705608637
########## be/src/vec/exprs/vruntimefilter_wrapper.h: ########## @@ -65,32 +72,42 @@ class VRuntimeFilterWrapper final : public VExpr { _always_true_counter = always_true_counter; } - // if filter rate less than this, bloom filter will set always true - constexpr static double EXPECTED_FILTER_RATE = 0.4; + template <typename T, typename TT> + static void judge_selectivity(double ignore_threshold, int64_t filter_rows, int64_t input_rows, + T& always_true, TT& judge_counter) { + always_true = filter_rows / (input_rows * 1.0) < ignore_threshold; + judge_counter = config::runtime_filter_sampling_frequency; + } - static void calculate_filter(double ignore_threshold, int64_t filter_rows, int64_t scan_rows, - bool& has_calculate, bool& always_true) { - if ((!has_calculate) && (scan_rows > config::rf_predicate_check_row_num)) { - if (filter_rows / (scan_rows * 1.0) < ignore_threshold) { - always_true = true; - } - has_calculate = true; + bool need_judge_selectivity() override { + if (_judge_counter <= 0) { + _always_true = false; + return true; Review Comment: warning: redundant boolean literal in conditional return statement [readability-simplify-boolean-expr] be/src/vec/exprs/vruntimefilter_wrapper.h:82: ```diff - if (_judge_counter <= 0) { - _always_true = false; - return true; - } - return false; + return _judge_counter <= 0; ``` -- 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