This is an automated email from the ASF dual-hosted git repository. panxiaolei pushed a commit to branch refactor_rf in repository https://gitbox.apache.org/repos/asf/doris.git
commit 14d85abda1c99db9c5a8cae81a9037dda86ee986 Author: BiteTheDDDDt <x...@selectdb.com> AuthorDate: Wed Feb 19 21:29:12 2025 +0800 update --- be/src/exprs/bloom_filter_func.h | 4 ++-- be/src/runtime_filter/role/runtime_filter.cpp | 3 ++- be/src/runtime_filter/runtime_filter_definitions.h | 2 +- be/src/runtime_filter/runtime_filter_wrapper.cpp | 6 +++--- be/test/pipeline/pipeline_test.cpp | 2 +- be/test/pipeline/thrift_builder.h | 4 ++-- .../src/main/java/org/apache/doris/planner/RuntimeFilter.java | 4 ++-- gensrc/thrift/PlanNodes.thrift | 2 +- 8 files changed, 14 insertions(+), 13 deletions(-) diff --git a/be/src/exprs/bloom_filter_func.h b/be/src/exprs/bloom_filter_func.h index 8a842fc9b77..b8c11e5b8fe 100644 --- a/be/src/exprs/bloom_filter_func.h +++ b/be/src/exprs/bloom_filter_func.h @@ -125,7 +125,7 @@ public: void init_params(const RuntimeFilterParams* params) { _bloom_filter_length = params->bloom_filter_size; - _build_bf_by_runtime_size = params->build_bf_exactly; + _build_bf_by_runtime_size = params->build_bf_by_runtime_size; _runtime_bloom_filter_min_size = params->runtime_bloom_filter_min_size; _runtime_bloom_filter_max_size = params->runtime_bloom_filter_max_size; _null_aware = params->null_aware; @@ -138,7 +138,7 @@ public: bool build_bf_by_runtime_size() const { return _build_bf_by_runtime_size; } - Status init_with_cardinality(const size_t runtime_size) { + Status init_with_runtime_size(const size_t runtime_size) { if (_build_bf_by_runtime_size) { // Use the same algorithm as org.apache.doris.planner.RuntimeFilter#calculateFilterSize constexpr double fpp = 0.05; diff --git a/be/src/runtime_filter/role/runtime_filter.cpp b/be/src/runtime_filter/role/runtime_filter.cpp index 29625f0737b..6289afd5d76 100644 --- a/be/src/runtime_filter/role/runtime_filter.cpp +++ b/be/src/runtime_filter/role/runtime_filter.cpp @@ -92,7 +92,8 @@ Status RuntimeFilter::_init_with_desc(const TRuntimeFilterDesc* desc, ? options->runtime_bloom_filter_max_size : 0; - params.build_bf_exactly = desc->__isset.build_bf_exactly && desc->build_bf_exactly; + params.build_bf_by_runtime_size = + desc->__isset.build_bf_by_runtime_size && desc->build_bf_by_runtime_size; params.bloom_filter_size_calculated_by_ndv = desc->bloom_filter_size_calculated_by_ndv; if (desc->__isset.bloom_filter_size_bytes) { diff --git a/be/src/runtime_filter/runtime_filter_definitions.h b/be/src/runtime_filter/runtime_filter_definitions.h index 5ca07793a8a..7bd7234079d 100644 --- a/be/src/runtime_filter/runtime_filter_definitions.h +++ b/be/src/runtime_filter/runtime_filter_definitions.h @@ -44,7 +44,7 @@ struct RuntimeFilterParams { int64_t runtime_bloom_filter_max_size {}; int32_t filter_id {}; bool bitmap_filter_not_in {}; - bool build_bf_exactly {}; + bool build_bf_by_runtime_size {}; bool bloom_filter_size_calculated_by_ndv {}; bool null_aware {}; diff --git a/be/src/runtime_filter/runtime_filter_wrapper.cpp b/be/src/runtime_filter/runtime_filter_wrapper.cpp index 4ea449286be..f688af21a4c 100644 --- a/be/src/runtime_filter/runtime_filter_wrapper.cpp +++ b/be/src/runtime_filter/runtime_filter_wrapper.cpp @@ -243,7 +243,7 @@ Status RuntimeFilterWrapper::init_bloom_filter(const size_t runtime_size) { throw Exception(ErrorCode::INTERNAL_ERROR, "init_bloom_filter meet invalid input type {}", int(_filter_type)); } - return _bloom_filter_func->init_with_cardinality(runtime_size); + return _bloom_filter_func->init_with_runtime_size(runtime_size); } void RuntimeFilterWrapper::insert_to_bloom_filter(BloomFilterFuncBase* bloom_filter) const { @@ -360,8 +360,8 @@ Status RuntimeFilterWrapper::merge(const RuntimeFilterWrapper* other) { if (real_filter_type == RuntimeFilterType::IN_FILTER) { // when we meet base rf is in-filter, threre only have two case: - // case1: all input-filter's build_bf_exactly is true, inited by synced global size - // case2: all input-filter's build_bf_exactly is false, inited by default size + // case1: all input-filter's build_bf_by_runtime_size is true, inited by synced global size + // case2: all input-filter's build_bf_by_runtime_size is false, inited by default size if (other_filter_type == RuntimeFilterType::IN_FILTER) { _hybrid_set->insert(other->_hybrid_set.get()); if (_max_in_num >= 0 && _hybrid_set->size() >= _max_in_num) { diff --git a/be/test/pipeline/pipeline_test.cpp b/be/test/pipeline/pipeline_test.cpp index be5845643a2..f94a7ab1876 100644 --- a/be/test/pipeline/pipeline_test.cpp +++ b/be/test/pipeline/pipeline_test.cpp @@ -797,7 +797,7 @@ TEST_F(PipelineTest, PLAN_HASH_JOIN) { .build(), 0, std::map<TPlanNodeId, TExpr> {}) .set_bloom_filter_size_bytes(1048576) - .set_build_bf_exactly(false) + .set_build_bf_by_runtime_size(false) .build()) .build(); diff --git a/be/test/pipeline/thrift_builder.h b/be/test/pipeline/thrift_builder.h index 1af1ca760bd..e7ed50d5718 100644 --- a/be/test/pipeline/thrift_builder.h +++ b/be/test/pipeline/thrift_builder.h @@ -186,8 +186,8 @@ public: _desc.__set_bloom_filter_size_bytes(bloom_filter_size_bytes); return *this; } - TRuntimeFilterDescBuilder& set_build_bf_exactly(bool build_bf_exactly) { - _desc.__set_build_bf_exactly(build_bf_exactly); + TRuntimeFilterDescBuilder& set_build_bf_by_runtime_size(bool build_bf_by_runtime_size) { + _desc.__set_build_bf_by_runtime_size(build_bf_by_runtime_size); return *this; } TRuntimeFilterDesc& build() { return _desc; } diff --git a/fe/fe-core/src/main/java/org/apache/doris/planner/RuntimeFilter.java b/fe/fe-core/src/main/java/org/apache/doris/planner/RuntimeFilter.java index 80497798083..05c1d449ae1 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/planner/RuntimeFilter.java +++ b/fe/fe-core/src/main/java/org/apache/doris/planner/RuntimeFilter.java @@ -244,9 +244,9 @@ public final class RuntimeFilter { // 2. rf type may be bf // 3. each filter only acts on self instance(do not need any shuffle), or size of // all filters will be same - boolean buildBfExactly = singleEq && (runtimeFilterType == TRuntimeFilterType.IN_OR_BLOOM + boolean buildBfByRuntimeSize = singleEq && (runtimeFilterType == TRuntimeFilterType.IN_OR_BLOOM || runtimeFilterType == TRuntimeFilterType.BLOOM) && (!needShuffle || hasGlobalSize); - tFilter.setBuildBfExactly(buildBfExactly); + tFilter.setbuildBfByRuntimeSize(buildBfByRuntimeSize); tFilter.setType(runtimeFilterType); tFilter.setBloomFilterSizeBytes(filterSizeBytes); diff --git a/gensrc/thrift/PlanNodes.thrift b/gensrc/thrift/PlanNodes.thrift index a46cc8f7299..43ada0bdae3 100644 --- a/gensrc/thrift/PlanNodes.thrift +++ b/gensrc/thrift/PlanNodes.thrift @@ -1297,7 +1297,7 @@ struct TRuntimeFilterDesc { 16: optional bool sync_filter_size; // Deprecated - 17: optional bool build_bf_exactly; + 17: optional bool build_bf_by_runtime_size; } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org