-
Notifications
You must be signed in to change notification settings - Fork 315
fix: fix rewrite_not to process complex nested not #1431
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
bda2afc to
2efe39a
Compare
3f1efa1 to
5dd53e6
Compare
b7bf0d3 to
197367b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @ZENOTME for this pr, generally LGTM!
| Ok(Predicate::Unary(UnaryExpression::new( | ||
| PredicateOperator::IsNull, | ||
| reference.clone(), | ||
| ))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should just return predicate.clone() here?
crates/iceberg/src/expr/predicate.rs
Outdated
| @@ -1466,4 +1447,29 @@ mod tests { | |||
| assert_eq!(&format!("{bound_expr}"), r#"True"#); | |||
| test_bound_predicate_serialize_diserialize(bound_expr); | |||
| } | |||
|
|
|||
| #[test] | |||
| fn test_rewrite_not_deeply_nested() { | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better to move this test to rewrite_not?
197367b to
b9de84d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @ZENOTME for this pr, LGTM!
Which issue does this PR close?
What changes are included in this PR?
Original
rewrite_notcan't process nested not expression likenot(not(not(bar > 1000))).This PR uses visitor to implement rewrite_not so that it can process nested not expression recursively.Are these changes tested?
unit test