This is an automated email from the ASF dual-hosted git repository.

gabriellee pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new c7b8c83a7f [Improvement](runtimefilter) Build bloom filter according 
to the exact build size for IN_OR_BLOOM_FILTER (#20166)
c7b8c83a7f is described below

commit c7b8c83a7fa87ddbf12b2dae7bfd4015d99f8d5b
Author: Gabriel <gabrielleeb...@gmail.com>
AuthorDate: Tue May 30 12:55:30 2023 +0800

    [Improvement](runtimefilter) Build bloom filter according to the exact 
build size for IN_OR_BLOOM_FILTER (#20166)
    
    * [Improvement](runtimefilter) Build bloom filter according to the exact 
build size for IN_OR_BLOOM_FILTER
---
 be/src/exprs/runtime_filter.cpp     | 7 +++++--
 be/src/exprs/runtime_filter_slots.h | 2 +-
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/be/src/exprs/runtime_filter.cpp b/be/src/exprs/runtime_filter.cpp
index f8a3ffc8d4..499c291ae5 100644
--- a/be/src/exprs/runtime_filter.cpp
+++ b/be/src/exprs/runtime_filter.cpp
@@ -421,6 +421,7 @@ public:
             _context.hybrid_set.reset(create_set(_column_return_type));
             
_context.bloom_filter_func.reset(create_bloom_filter(_column_return_type));
             _context.bloom_filter_func->set_length(params->bloom_filter_size);
+            
_context.bloom_filter_func->set_build_bf_exactly(params->build_bf_exactly);
             return Status::OK();
         }
         case RuntimeFilterType::BITMAP_FILTER: {
@@ -445,7 +446,8 @@ public:
     }
 
     Status init_bloom_filter(const size_t build_bf_cardinality) {
-        DCHECK(_filter_type == RuntimeFilterType::BLOOM_FILTER);
+        DCHECK(_filter_type == RuntimeFilterType::BLOOM_FILTER ||
+               _filter_type == RuntimeFilterType::IN_OR_BLOOM_FILTER);
         return 
_context.bloom_filter_func->init_with_cardinality(build_bf_cardinality);
     }
 
@@ -1360,7 +1362,8 @@ Status IRuntimeFilter::init_with_desc(const 
TRuntimeFilterDesc* desc, const TQue
     // 2. Do not have remote target (e.g. do not need to merge)
     // 3. Bloom filter
     params.build_bf_exactly = build_bf_exactly && !_has_remote_target &&
-                              _runtime_filter_type == 
RuntimeFilterType::BLOOM_FILTER;
+                              (_runtime_filter_type == 
RuntimeFilterType::BLOOM_FILTER ||
+                               _runtime_filter_type == 
RuntimeFilterType::IN_OR_BLOOM_FILTER);
     if (desc->__isset.bloom_filter_size_bytes) {
         params.bloom_filter_size = desc->bloom_filter_size_bytes;
     }
diff --git a/be/src/exprs/runtime_filter_slots.h 
b/be/src/exprs/runtime_filter_slots.h
index 3367e8d44a..b1f4b125b4 100644
--- a/be/src/exprs/runtime_filter_slots.h
+++ b/be/src/exprs/runtime_filter_slots.h
@@ -104,7 +104,7 @@ public:
                 runtime_filter->change_to_bloom_filter();
             }
 
-            if (runtime_filter->type() == RuntimeFilterType::BLOOM_FILTER) {
+            if (runtime_filter->is_bloomfilter()) {
                 
RETURN_IF_ERROR(runtime_filter->init_bloom_filter(build_bf_cardinality));
             }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to