Skip to content

Commit

Permalink
[BugFix] Reset all fields of runtime filter when exceeding global bui…
Browse files Browse the repository at this point in the history
…ld size (#35776)

Signed-off-by: zihe.liu <[email protected]>
Signed-off-by: ZiheLiu <[email protected]>
(cherry picked from commit ff58c88)
  • Loading branch information
ZiheLiu authored and wanpengfei-git committed Nov 24, 2023
1 parent 6fd5113 commit 54907c4
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 2 deletions.
4 changes: 2 additions & 2 deletions be/src/exprs/runtime_filter.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,9 @@ class SimdBlockFilter {

// Common:
// log_num_buckets_ is the log (base 2) of the number of buckets in the directory:
int _log_num_buckets;
int _log_num_buckets = 0;
// directory_mask_ is (1 << log_num_buckets_) - 1
uint32_t _directory_mask;
uint32_t _directory_mask = 0;
Bucket* _directory = nullptr;
};

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
-- name: test_global_runtime_filter_exceed_limit
create table t1 (
k1 int
)
duplicate key(k1)
distributed by hash(k1) buckets 32
properties("replication_num" = "1");
-- result:
-- !result
insert into t1 select generate_series FROM TABLE(generate_series(1, 65535));
-- result:
-- !result
insert into t1 select k1 + 65535 from t1;
-- result:
-- !result
insert into t1 select k1 + 65535*2 from t1;
-- result:
-- !result
insert into t1 select k1 + 65535*3 from t1;
-- result:
-- !result
with tw1 as (
select t1.k1 from t1 join [broadcast] t1 t2 using(k1)
)
select /*+SET_VAR(global_runtime_filter_build_max_size=1,global_runtime_filter_probe_min_size=0)*/
count(1) from tw1 join [broadcast] t1 t3 using(k1);
-- result:
917490
-- !result
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
-- name: test_global_runtime_filter_exceed_limit
create table t1 (
k1 int
)
duplicate key(k1)
distributed by hash(k1) buckets 32
properties("replication_num" = "1");

insert into t1 select generate_series FROM TABLE(generate_series(1, 65535));
insert into t1 select k1 + 65535 from t1;
insert into t1 select k1 + 65535*2 from t1;
insert into t1 select k1 + 65535*3 from t1;

with tw1 as (
select t1.k1 from t1 join [broadcast] t1 t2 using(k1)
)
select /*+SET_VAR(global_runtime_filter_build_max_size=1,global_runtime_filter_probe_min_size=0)*/
count(1) from tw1 join [broadcast] t1 t3 using(k1);

0 comments on commit 54907c4

Please sign in to comment.