src255 commented on PR #3915:
URL:
https://github.com/apache/arrow-datafusion/pull/3915#issuecomment-1287373139
Thanks for the feedback. Here is the new test I wrote with
`test_simplify_optimized_plan` as a guide:
```rust
#[test]
fn test_simplify_optimized_plan_with_or() {
let table_scan = test_table_scan();
let plan = LogicalPlanBuilder::from(table_scan)
.project(vec![col("a")])
.unwrap()
.filter(or(col("b").gt(lit(1)), col("b").gt(lit(1)))) // use `or`
instead of `and`
.unwrap()
.build()
.unwrap();
assert_optimized_plan_eq(
&plan,
"\
Filter: test.b > Int32(1)\
\n Projection: test.a\
\n TableScan: test",
);
}
```
After running this test, I noticed that both
`test_simplify_optimized_plan_with_or` and `test_simplify_optimized_plan` pass
without my changes (`OR` and `AND` changes commented out)! Perhaps the
optimizer is already making *both* simplifications:
- `a OR a` --> `a`
- `a AND a` --> `a`.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]