Skip to content

Expand noop_filter_removal_rule patterns#56

Merged
ryancinsight merged 1 commit intomainfrom
optimizer-noop-filter-extensions-855255640421650916
Jan 11, 2026
Merged

Expand noop_filter_removal_rule patterns#56
ryancinsight merged 1 commit intomainfrom
optimizer-noop-filter-extensions-855255640421650916

Conversation

@google-labs-jules
Copy link
Contributor

@google-labs-jules google-labs-jules bot commented Jan 11, 2026

Expand noop_filter_removal_rule to handle OR and NOT patterns. This allows the optimizer to remove filters like x OR true and NOT false by evaluating them as always true. Implemented is_always_false helper to support these checks. Added comprehensive tests.


PR created automatically by Jules for task 855255640421650916 started by @ryancinsight

High-level PR Summary

This PR enhances the query optimizer's noop_filter_removal_rule by expanding its pattern matching capabilities. The changes add support for detecting and removing always-true filter expressions involving OR operations (like x OR true or true OR x) and NOT operations (like NOT false). A new helper function is_always_false was introduced to support recursive evaluation of complex boolean expressions. The implementation includes comprehensive test coverage for the new patterns, including edge cases with nested boolean expressions.

⏱️ Estimated Review Time: 15-30 minutes

💡 Review Order Suggestion
Order File Path
1 src/core/optimizer/rules/noop_filter_removal_rule.rs
2 src/core/optimizer/rules/tests/noop_filter_removal_tests.rs

Need help? Join our Discord

- Expanded `is_always_true` to handle `BinaryOp` with `OR` and `UnaryOp` with `NOT`.
- Added `is_always_false` helper function to support logical negation.
- Added tests for `OR true`, `true OR`, `NOT false` and recursive cases.
@google-labs-jules
Copy link
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@coderabbitai
Copy link

coderabbitai bot commented Jan 11, 2026

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

@openhands-ai
Copy link

openhands-ai bot commented Jan 11, 2026

Looks like there are a few issues preventing this PR from being merged!

  • GitHub Actions are failing:
    • Rust CI
    • Rust CI

If you'd like me to help, just leave a comment, like

@OpenHands please fix the failing actions on PR #56 at branch `optimizer-noop-filter-extensions-855255640421650916`

Feel free to include any additional details that might help me get this PR into a better state.

You can manage your notification settings

Copy link

@recurseml recurseml bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review by RecurseML

🔍 Review performed on 1740f02..7a08fcb

✨ No bugs found, your code is sparkling clean

✅ Files analyzed, no issues (2)

src/core/optimizer/rules/noop_filter_removal_rule.rs
src/core/optimizer/rules/tests/noop_filter_removal_tests.rs

@ryancinsight ryancinsight marked this pull request as ready for review January 11, 2026 06:11
@ryancinsight ryancinsight merged commit 3751420 into main Jan 11, 2026
2 of 4 checks passed
@ryancinsight ryancinsight deleted the optimizer-noop-filter-extensions-855255640421650916 branch January 11, 2026 06:12
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.

1 participant