This is an automated email from the ASF dual-hosted git repository. lihaopeng pushed a commit to branch tpcds in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/tpcds by this push: new 0acc9701e71 fix support rf change bf size by build exactly (#30385) 0acc9701e71 is described below commit 0acc9701e71b0e49413303b1248984c8d211e88c Author: HappenLee <happen...@hotmail.com> AuthorDate: Thu Jan 25 20:50:47 2024 +0800 fix support rf change bf size by build exactly (#30385) --- be/src/exprs/bloom_filter_func.h | 5 ----- be/src/exprs/runtime_filter.cpp | 14 ++++++++------ 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/be/src/exprs/bloom_filter_func.h b/be/src/exprs/bloom_filter_func.h index fa3a8e49d1a..ed4205a7e0d 100644 --- a/be/src/exprs/bloom_filter_func.h +++ b/be/src/exprs/bloom_filter_func.h @@ -83,11 +83,6 @@ class BloomFilterFuncBase : public FilterFuncBase { public: virtual ~BloomFilterFuncBase() = default; - Status init(int64_t expect_num, double fpp) { - size_t filter_size = BloomFilterAdaptor::optimal_bit_num(expect_num, fpp); - return init_with_fixed_length(filter_size); - } - void set_length(int64_t bloom_filter_length) { _bloom_filter_length = bloom_filter_length; } void set_build_bf_exactly(bool build_bf_exactly) { _build_bf_exactly = build_bf_exactly; } diff --git a/be/src/exprs/runtime_filter.cpp b/be/src/exprs/runtime_filter.cpp index 9b15f3dce2b..847b5a1746e 100644 --- a/be/src/exprs/runtime_filter.cpp +++ b/be/src/exprs/runtime_filter.cpp @@ -338,15 +338,17 @@ public: return Status::OK(); } - void change_to_bloom_filter() { + void change_to_bloom_filter(bool need_init_bf = false) { CHECK(_filter_type == RuntimeFilterType::IN_OR_BLOOM_FILTER) << "Can not change to bloom filter because of runtime filter type is " << IRuntimeFilter::to_string(_filter_type); _is_bloomfilter = true; BloomFilterFuncBase* bf = _context.bloom_filter_func.get(); - // BloomFilter may be not init - static_cast<void>(bf->init_with_fixed_length()); - insert_to_bloom_filter(bf); + if (need_init_bf) { + // BloomFilter may be not init + static_cast<void>(bf->init_with_fixed_length()); + insert_to_bloom_filter(bf); + } // release in filter _context.hybrid_set.reset(create_set(_column_return_type)); } @@ -533,12 +535,12 @@ public: VLOG_DEBUG << " change runtime filter to bloom filter(id=" << _filter_id << ") because: in_num(" << _context.hybrid_set->size() << ") >= max_in_num(" << _max_in_num << ")"; - change_to_bloom_filter(); + change_to_bloom_filter(true); } } else { VLOG_DEBUG << " change runtime filter to bloom filter(id=" << _filter_id << ") because: already exist a bloom filter"; - change_to_bloom_filter(); + change_to_bloom_filter(true); RETURN_IF_ERROR(_context.bloom_filter_func->merge( wrapper->_context.bloom_filter_func.get())); } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org