diff --git a/be/src/exprs/runtime_filter.h b/be/src/exprs/runtime_filter.h index 0e65815135db3..df7b16b197d35 100644 --- a/be/src/exprs/runtime_filter.h +++ b/be/src/exprs/runtime_filter.h @@ -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; }; diff --git a/test/sql/test_runtime_filter/R/test_global_runtime_filter_exceed_limit b/test/sql/test_runtime_filter/R/test_global_runtime_filter_exceed_limit new file mode 100644 index 0000000000000..44eaa26185bd9 --- /dev/null +++ b/test/sql/test_runtime_filter/R/test_global_runtime_filter_exceed_limit @@ -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 \ No newline at end of file diff --git a/test/sql/test_runtime_filter/T/test_global_runtime_filter_exceed_limit b/test/sql/test_runtime_filter/T/test_global_runtime_filter_exceed_limit new file mode 100644 index 0000000000000..142377a70f479 --- /dev/null +++ b/test/sql/test_runtime_filter/T/test_global_runtime_filter_exceed_limit @@ -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);