@@ -500,11 +500,15 @@ fn push_down_all_join(
500500 }
501501
502502 if let Some ( predicate) = conjunction ( left_push) {
503- join. left = Arc :: new ( LogicalPlan :: Filter ( Filter :: new ( predicate, join. left ) ) ) ;
503+ join. left = Arc :: new ( LogicalPlan :: Filter ( Filter :: new_unchecked (
504+ predicate, join. left ,
505+ ) ) ) ;
504506 }
505507
506508 if let Some ( predicate) = conjunction ( right_push) {
507- join. right = Arc :: new ( LogicalPlan :: Filter ( Filter :: new ( predicate, join. right ) ) ) ;
509+ join. right = Arc :: new ( LogicalPlan :: Filter ( Filter :: new_unchecked (
510+ predicate, join. right ,
511+ ) ) ) ;
508512 }
509513
510514 // Add any new join conditions as the non join predicates
@@ -963,7 +967,7 @@ impl OptimizerRule for PushDownFilter {
963967
964968 let push_predicate =
965969 replace_cols_by_name ( filter. predicate . clone ( ) , & replace_map) ?;
966- inputs. push ( Arc :: new ( LogicalPlan :: Filter ( Filter :: new (
970+ inputs. push ( Arc :: new ( LogicalPlan :: Filter ( Filter :: new_unchecked (
967971 push_predicate,
968972 input,
969973 ) ) ) )
@@ -1225,7 +1229,7 @@ impl OptimizerRule for PushDownFilter {
12251229 . inputs ( )
12261230 . into_iter ( )
12271231 . map ( |child| {
1228- LogicalPlan :: Filter ( Filter :: new (
1232+ LogicalPlan :: Filter ( Filter :: new_unchecked (
12291233 predicate. clone ( ) ,
12301234 Arc :: new ( child. clone ( ) ) ,
12311235 ) )
@@ -1308,7 +1312,7 @@ fn rewrite_projection(
13081312 let projection = if let Some ( expr) = conjunction ( push_predicates) {
13091313 // re-write all filters based on this projection
13101314 // E.g. in `Filter: b\n Projection: a > 1 as b`, we can swap them, but the filter must be "a > 1"
1311- projection. input = Arc :: new ( LogicalPlan :: Filter ( Filter :: new (
1315+ projection. input = Arc :: new ( LogicalPlan :: Filter ( Filter :: new_unchecked (
13121316 replace_cols_by_name ( expr, & pushable_map) ?,
13131317 projection. input ,
13141318 ) ) ) ;
@@ -1389,7 +1393,7 @@ fn contain<T>(expr: &Expr, check_map: &HashMap<String, T>) -> bool {
13891393
13901394fn with_filters ( predicates : Vec < Expr > , plan : LogicalPlan ) -> LogicalPlan {
13911395 if let Some ( predicate) = conjunction ( predicates) {
1392- LogicalPlan :: Filter ( Filter :: new ( predicate, Arc :: new ( plan) ) )
1396+ LogicalPlan :: Filter ( Filter :: new_unchecked ( predicate, Arc :: new ( plan) ) )
13931397 } else {
13941398 plan
13951399 }
0 commit comments