From 513555a820fd108c8e628688d0577c7bd15f01ef Mon Sep 17 00:00:00 2001 From: "xudong.w" Date: Wed, 21 Feb 2024 10:04:41 +0800 Subject: [PATCH] chore: minor refactor of `adjust_bloom_runtime_filter` (#14697) chore: minor refactor for adjust_bloom_runtime_filter Co-authored-by: Bohu --- .../transforms/hash_join/hash_join_build_state.rs | 7 ++----- .../sql/src/executor/physical_plans/physical_hash_join.rs | 4 ++++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/query/service/src/pipelines/processors/transforms/hash_join/hash_join_build_state.rs b/src/query/service/src/pipelines/processors/transforms/hash_join/hash_join_build_state.rs index ce06c3f5d9fa..e8bd5f670bcc 100644 --- a/src/query/service/src/pipelines/processors/transforms/hash_join/hash_join_build_state.rs +++ b/src/query/service/src/pipelines/processors/transforms/hash_join/hash_join_build_state.rs @@ -152,11 +152,8 @@ impl HashJoinBuildState { if !is_cluster || is_broadcast_join { enable_inlist_runtime_filter = true; enable_min_max_runtime_filter = true; - if ctx.get_settings().get_bloom_runtime_filter()? - && hash_join_state.hash_join_desc.enable_bloom_runtime_filter - { - enable_bloom_runtime_filter = true; - } + enable_bloom_runtime_filter = + hash_join_state.hash_join_desc.enable_bloom_runtime_filter; } } let chunk_size_limit = ctx.get_settings().get_max_block_size()? as usize * 16; diff --git a/src/query/sql/src/executor/physical_plans/physical_hash_join.rs b/src/query/sql/src/executor/physical_plans/physical_hash_join.rs index 6d7116d07f55..9ad2413407f8 100644 --- a/src/query/sql/src/executor/physical_plans/physical_hash_join.rs +++ b/src/query/sql/src/executor/physical_plans/physical_hash_join.rs @@ -528,6 +528,10 @@ async fn adjust_bloom_runtime_filter( table_index: Option, s_expr: &SExpr, ) -> Result { + // The setting of `enable_bloom_runtime_filter` is true by default. + if !ctx.get_settings().get_bloom_runtime_filter()? { + return Ok(false); + } if let Some(table_index) = table_index { let table = metadata.read().table(table_index).table(); if let Some(stats) = table.table_statistics(ctx.clone()).await? {