Skip to content

Commit c50606c

Browse files
authored
fix: enable runtime filter when join_spilling_memory_ratio !=0 (#14959)
* chore: test q17 * test * test * test
1 parent 880e236 commit c50606c

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

โ€Žsrc/query/service/src/pipelines/processors/transforms/hash_join/hash_join_build_state.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,7 @@ impl HashJoinBuildState {
150150
let mut enable_bloom_runtime_filter = false;
151151
let mut enable_inlist_runtime_filter = false;
152152
let mut enable_min_max_runtime_filter = false;
153-
if supported_join_type_for_runtime_filter(&hash_join_state.hash_join_desc.join_type)
154-
&& ctx.get_settings().get_join_spilling_memory_ratio()? == 0
155-
{
153+
if supported_join_type_for_runtime_filter(&hash_join_state.hash_join_desc.join_type) {
156154
let is_cluster = !ctx.get_cluster().is_empty();
157155
// For cluster, only support runtime filter for broadcast join.
158156
let is_broadcast_join = hash_join_state.hash_join_desc.broadcast;
@@ -324,7 +322,10 @@ impl HashJoinBuildState {
324322
.clone()
325323
};
326324

327-
self.add_runtime_filter(&build_chunks, build_num_rows)?;
325+
// If spilling happened, skip adding runtime filter, because probe data is ready and spilled.
326+
if self.spilled_partition_set.read().is_empty() {
327+
self.add_runtime_filter(&build_chunks, build_num_rows)?;
328+
}
328329

329330
if self.hash_join_state.hash_join_desc.join_type == JoinType::Cross {
330331
return Ok(());

โ€Žtests/sqllogictests/suites/tpch/queries.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -802,6 +802,7 @@ Brand#13 LARGE BURNISHED COPPER 45 8
802802
Brand#13 MEDIUM ANODIZED STEEL 23 8
803803

804804
#Q17
805+
805806
query I
806807
select
807808
truncate(sum(l_extendedprice) / 7.0,8) as avg_yearly

0 commit comments

Comments
ย (0)