From 77b4af96ec8413ea635deb3a20938daa1bad874a Mon Sep 17 00:00:00 2001
From: Dousir9 <736191200@qq.com>
Date: Sun, 17 Nov 2024 16:27:48 +0800
Subject: [PATCH 1/7] chore(query): improve distributed runtime filter
---
src/query/catalog/src/runtime_filter_info.rs | 23 +++++++++
src/query/catalog/src/table_context.rs | 9 ++++
.../pipelines/builders/builder_aggregate.rs | 1 +
.../src/pipelines/builders/builder_join.rs | 1 +
.../src/pipelines/builders/builder_scan.rs | 2 +
.../service/src/pipelines/pipeline_builder.rs | 3 ++
.../transforms/hash_join/build_state.rs | 5 ++
.../hash_join/hash_join_build_state.rs | 48 +++++++++++++++++++
src/query/service/src/sessions/query_ctx.rs | 34 +++++++++++++
.../service/src/sessions/query_ctx_shared.rs | 8 ++++
.../tests/it/sql/exec/get_table_bind_test.rs | 16 +++++++
.../it/storages/fuse/operations/commit.rs | 16 +++++++
.../read/parquet_data_source_deserializer.rs | 39 +++++++++++++++
13 files changed, 205 insertions(+)
diff --git a/src/query/catalog/src/runtime_filter_info.rs b/src/query/catalog/src/runtime_filter_info.rs
index 7c29f193879f..45df674267c5 100644
--- a/src/query/catalog/src/runtime_filter_info.rs
+++ b/src/query/catalog/src/runtime_filter_info.rs
@@ -12,6 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
+use databend_common_base::base::tokio::sync::watch;
+use databend_common_base::base::tokio::sync::watch::Receiver;
+use databend_common_base::base::tokio::sync::watch::Sender;
use databend_common_expression::Expr;
use xorf::BinaryFuse16;
@@ -62,4 +65,24 @@ impl RuntimeFilterInfo {
pub fn is_empty(&self) -> bool {
self.inlist.is_empty() && self.bloom.is_empty() && self.min_max.is_empty()
}
+
+ pub fn is_blooms_empty(&self) -> bool {
+ self.bloom.is_empty()
+ }
+}
+
+pub struct RuntimeFilterReady {
+ pub runtime_filter_watcher: Sender