berkaysynnada commented on code in PR #15568: URL: https://github.com/apache/datafusion/pull/15568#discussion_r2037022463
########## datafusion/physical-expr/src/expressions/dynamic_filters.rs: ########## @@ -0,0 +1,442 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +use std::{ + any::Any, + fmt::Display, + hash::Hash, + sync::{Arc, RwLock}, +}; + +use crate::{utils::conjunction, PhysicalExpr}; +use arrow::datatypes::{DataType, Schema}; +use datafusion_common::{ + tree_node::{Transformed, TransformedResult, TreeNode}, + Result, +}; +use datafusion_expr::ColumnarValue; +use datafusion_physical_expr_common::physical_expr::{DynEq, DynHash}; + +/// A source of dynamic runtime filters. +/// +/// Operators can create implementations of this trait that get wrapped +/// in [`DynamicFilterPhysicalExpr`] to be pushed down into and through to scans, joins, etc. +/// +/// For example: +/// - A `HashJoin` operator can use this to provide a filter expression +/// that filters out rows from the right side of the join based on the +/// values from the left side. +/// - A `TopK` operator can use this to provide a filter expression +/// that filters out rows from the input based on the values from the +/// top K rows. +/// +/// Initially this trait is intended to be only for internal use as a way to facilitate +/// building [`DynamicFilterPhysicalExpr`]s in the various operators that will be generating +/// dynamic filters. +/// Because of this we've made it a public trait in a private module so that it is only +/// accessible within the crate. +/// If you would like to use this trait in your own code, please open an issue +/// to discuss the use case and we can consider making it public. +pub trait DynamicFilterSource: Review Comment: > @berkaysynnada please take a look at [bdbd438](https://github.com/apache/datafusion/commit/bdbd438c53154df4bdc1d42f3eac62e8785f2366), I think it makes things simpler 😄 It seems better to me as well :D -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org