Skip to content

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

Merged
merged 2 commits into from
Jun 19, 2025

Conversation

ZENOTME
Copy link
Contributor

@ZENOTME ZENOTME commented Jun 10, 2025

Which issue does this PR close?

What changes are included in this PR?

Original rewrite_not can't process nested not expression like not(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

@ZENOTME ZENOTME force-pushed the fix_manifest_filter branch from bda2afc to 2efe39a Compare June 11, 2025 15:30
@ZENOTME ZENOTME changed the title fix: fix not eval for manifest filter fix: fix rewrite_not to process complex nested not Jun 11, 2025
@ZENOTME ZENOTME force-pushed the fix_manifest_filter branch 2 times, most recently from 3f1efa1 to 5dd53e6 Compare June 11, 2025 17:07
@ZENOTME
Copy link
Contributor Author

ZENOTME commented Jun 11, 2025

@ZENOTME ZENOTME force-pushed the fix_manifest_filter branch 2 times, most recently from b7bf0d3 to 197367b Compare June 12, 2025 14:48
Copy link
Contributor

@liurenjie1024 liurenjie1024 left a 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!

Comment on lines 66 to 69
Ok(Predicate::Unary(UnaryExpression::new(
PredicateOperator::IsNull,
reference.clone(),
)))
Copy link
Contributor

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?

@@ -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() {
Copy link
Contributor

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?

@ZENOTME ZENOTME force-pushed the fix_manifest_filter branch from 197367b to b9de84d Compare June 18, 2025 13:42
Copy link
Contributor

@liurenjie1024 liurenjie1024 left a 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!

@liurenjie1024 liurenjie1024 merged commit f1e79c0 into apache:main Jun 19, 2025
17 checks passed
@ZENOTME ZENOTME deleted the fix_manifest_filter branch June 19, 2025 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants