@@ -785,7 +785,9 @@ impl OptimizerRule for PushDownFilter {
785
785
let new_predicates = simplify_predicates ( predicate) ?;
786
786
if old_predicate_len != new_predicates. len ( ) {
787
787
let Some ( new_predicate) = conjunction ( new_predicates) else {
788
- return plan_err ! ( "at least one expression exists" ) ;
788
+ // new_predicates is empty - remove the filter entirely
789
+ // Return the child plan without the filter
790
+ return Ok ( Transformed :: yes ( Arc :: unwrap_or_clone ( filter. input ) ) ) ;
789
791
} ;
790
792
filter. predicate = new_predicate;
791
793
}
@@ -2241,7 +2243,7 @@ mod tests {
2241
2243
plan,
2242
2244
@r"
2243
2245
Projection: test.a, test1.d
2244
- Cross Join:
2246
+ Cross Join:
2245
2247
Projection: test.a, test.b, test.c
2246
2248
TableScan: test, full_filters=[test.a = Int32(1)]
2247
2249
Projection: test1.d, test1.e, test1.f
@@ -2271,7 +2273,7 @@ mod tests {
2271
2273
plan,
2272
2274
@r"
2273
2275
Projection: test.a, test1.a
2274
- Cross Join:
2276
+ Cross Join:
2275
2277
Projection: test.a, test.b, test.c
2276
2278
TableScan: test, full_filters=[test.a = Int32(1)]
2277
2279
Projection: test1.a, test1.b, test1.c
0 commit comments