@@ -497,11 +497,15 @@ fn push_down_all_join(
497497 }
498498
499499 if let Some ( predicate) = conjunction ( left_push) {
500- join. left = Arc :: new ( LogicalPlan :: Filter ( Filter :: new ( predicate, join. left ) ) ) ;
500+ join. left = Arc :: new ( LogicalPlan :: Filter ( Filter :: new_unchecked (
501+ predicate, join. left ,
502+ ) ) ) ;
501503 }
502504
503505 if let Some ( predicate) = conjunction ( right_push) {
504- join. right = Arc :: new ( LogicalPlan :: Filter ( Filter :: new ( predicate, join. right ) ) ) ;
506+ join. right = Arc :: new ( LogicalPlan :: Filter ( Filter :: new_unchecked (
507+ predicate, join. right ,
508+ ) ) ) ;
505509 }
506510
507511 // Add any new join conditions as the non join predicates
@@ -960,7 +964,7 @@ impl OptimizerRule for PushDownFilter {
960964
961965 let push_predicate =
962966 replace_cols_by_name ( filter. predicate . clone ( ) , & replace_map) ?;
963- inputs. push ( Arc :: new ( LogicalPlan :: Filter ( Filter :: new (
967+ inputs. push ( Arc :: new ( LogicalPlan :: Filter ( Filter :: new_unchecked (
964968 push_predicate,
965969 input,
966970 ) ) ) )
@@ -1212,7 +1216,7 @@ impl OptimizerRule for PushDownFilter {
12121216 . inputs ( )
12131217 . into_iter ( )
12141218 . map ( |child| {
1215- LogicalPlan :: Filter ( Filter :: new (
1219+ LogicalPlan :: Filter ( Filter :: new_unchecked (
12161220 predicate. clone ( ) ,
12171221 Arc :: new ( child. clone ( ) ) ,
12181222 ) )
@@ -1295,7 +1299,7 @@ fn rewrite_projection(
12951299 let projection = if let Some ( expr) = conjunction ( push_predicates) {
12961300 // re-write all filters based on this projection
12971301 // E.g. in `Filter: b\n Projection: a > 1 as b`, we can swap them, but the filter must be "a > 1"
1298- projection. input = Arc :: new ( LogicalPlan :: Filter ( Filter :: new (
1302+ projection. input = Arc :: new ( LogicalPlan :: Filter ( Filter :: new_unchecked (
12991303 replace_cols_by_name ( expr, & pushable_map) ?,
13001304 projection. input ,
13011305 ) ) ) ;
@@ -1376,7 +1380,7 @@ fn contain<T>(expr: &Expr, check_map: &HashMap<String, T>) -> bool {
13761380
13771381fn with_filters ( predicates : Vec < Expr > , plan : LogicalPlan ) -> LogicalPlan {
13781382 if let Some ( predicate) = conjunction ( predicates) {
1379- LogicalPlan :: Filter ( Filter :: new ( predicate, Arc :: new ( plan) ) )
1383+ LogicalPlan :: Filter ( Filter :: new_unchecked ( predicate, Arc :: new ( plan) ) )
13801384 } else {
13811385 plan
13821386 }
0 commit comments