@@ -44,10 +44,10 @@ use datafusion_physical_expr::{
4444 aggregate:: AggregateExprBuilder , conjunction, Partitioning ,
4545} ;
4646use datafusion_physical_expr_common:: physical_expr:: fmt_sql;
47- use datafusion_physical_optimizer:: push_down_filter :: PushdownFilter ;
47+ use datafusion_physical_optimizer:: filter_pushdown :: FilterPushdown ;
4848use datafusion_physical_optimizer:: PhysicalOptimizerRule ;
4949use datafusion_physical_plan:: filter_pushdown:: {
50- FilterPushdownPropagation , FilterPushdowns ,
50+ FilterPushdownPropagation , PredicateSupports ,
5151} ;
5252use datafusion_physical_plan:: {
5353 aggregates:: { AggregateExec , AggregateMode , PhysicalGroupBy } ,
@@ -153,22 +153,21 @@ impl FileSource for TestSource {
153153
154154 fn try_pushdown_filters (
155155 & self ,
156- filters : & [ Arc < dyn PhysicalExpr > ] ,
156+ mut filters : Vec < Arc < dyn PhysicalExpr > > ,
157157 config : & ConfigOptions ,
158158 ) -> Result < FilterPushdownPropagation < Arc < dyn FileSource > > > {
159- let mut all_filters = filters. iter ( ) . map ( Arc :: clone) . collect :: < Vec < _ > > ( ) ;
160159 if self . support && config. execution . parquet . pushdown_filters {
161160 if let Some ( internal) = self . predicate . as_ref ( ) {
162- all_filters . push ( Arc :: clone ( internal) ) ;
161+ filters . push ( Arc :: clone ( internal) ) ;
163162 }
164163 let new_node = Arc :: new ( TestSource {
165164 support : true ,
166- predicate : Some ( conjunction ( all_filters . clone ( ) ) ) ,
165+ predicate : Some ( conjunction ( filters . clone ( ) ) ) ,
167166 statistics : self . statistics . clone ( ) , // should be updated in reality
168167 } ) ;
169168 Ok ( FilterPushdownPropagation {
170- parent_filter_result : FilterPushdowns :: all_supported ( & all_filters ) ,
171- new_node : Some ( new_node) ,
169+ filters : PredicateSupports :: all_supported ( filters ) ,
170+ updated_node : Some ( new_node) ,
172171 } )
173172 } else {
174173 Ok ( FilterPushdownPropagation :: unsupported ( filters) )
@@ -196,7 +195,7 @@ fn test_pushdown_into_scan() {
196195
197196 // expect the predicate to be pushed down into the DataSource
198197 insta:: assert_snapshot!(
199- OptimizationTest :: new( plan, PushdownFilter { } , true ) ,
198+ OptimizationTest :: new( plan, FilterPushdown { } , true ) ,
200199 @r"
201200 OptimizationTest:
202201 input:
@@ -220,7 +219,7 @@ fn test_pushdown_into_scan_with_config_options() {
220219 insta:: assert_snapshot!(
221220 OptimizationTest :: new(
222221 Arc :: clone( & plan) ,
223- PushdownFilter { } ,
222+ FilterPushdown { } ,
224223 false
225224 ) ,
226225 @r"
@@ -239,7 +238,7 @@ fn test_pushdown_into_scan_with_config_options() {
239238 insta:: assert_snapshot!(
240239 OptimizationTest :: new(
241240 plan,
242- PushdownFilter { } ,
241+ FilterPushdown { } ,
243242 true
244243 ) ,
245244 @r"
@@ -264,7 +263,7 @@ fn test_filter_collapse() {
264263 let plan = Arc :: new ( FilterExec :: try_new ( predicate2, filter1) . unwrap ( ) ) ;
265264
266265 insta:: assert_snapshot!(
267- OptimizationTest :: new( plan, PushdownFilter { } , true ) ,
266+ OptimizationTest :: new( plan, FilterPushdown { } , true ) ,
268267 @r"
269268 OptimizationTest:
270269 input:
@@ -294,7 +293,7 @@ fn test_filter_with_projection() {
294293
295294 // expect the predicate to be pushed down into the DataSource but the FilterExec to be converted to ProjectionExec
296295 insta:: assert_snapshot!(
297- OptimizationTest :: new( plan, PushdownFilter { } , true ) ,
296+ OptimizationTest :: new( plan, FilterPushdown { } , true ) ,
298297 @r"
299298 OptimizationTest:
300299 input:
@@ -318,7 +317,7 @@ fn test_filter_with_projection() {
318317 . unwrap ( ) ,
319318 ) ;
320319 insta:: assert_snapshot!(
321- OptimizationTest :: new( plan, PushdownFilter { } , true ) ,
320+ OptimizationTest :: new( plan, FilterPushdown { } , true ) ,
322321 @r"
323322 OptimizationTest:
324323 input:
@@ -347,7 +346,7 @@ fn test_push_down_through_transparent_nodes() {
347346
348347 // expect the predicate to be pushed down into the DataSource
349348 insta:: assert_snapshot!(
350- OptimizationTest :: new( plan, PushdownFilter { } , true ) ,
349+ OptimizationTest :: new( plan, FilterPushdown { } , true ) ,
351350 @r"
352351 OptimizationTest:
353352 input:
@@ -411,7 +410,7 @@ fn test_no_pushdown_through_aggregates() {
411410
412411 // expect the predicate to be pushed down into the DataSource
413412 insta:: assert_snapshot!(
414- OptimizationTest :: new( plan, PushdownFilter { } , true ) ,
413+ OptimizationTest :: new( plan, FilterPushdown { } , true ) ,
415414 @r"
416415 OptimizationTest:
417416 input:
0 commit comments