Repository navigation
fix: do not negate partially converted predicates - #59
Merged
Merged
Conversation
|
Not a reviewer/committer but I also ran into this issue and decided to take a look. Some (hopefully) helpful observations to move this PR forward:
GIven the above you can probably trim this down to a narrower PR |
terbed
force-pushed
the
fix/cast-pushdown
branch
from
November 12, 2026 11:20
f9e13b9 to
4916527
Compare
Contributor
Author
|
Thank you @debugmiller for the suggestions. |
Contributor
|
Hi @terbed, I see the PR description does not match the content, does it need to be updated? |
Contributor
Author
|
Hello @gabotechs, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #44
When one side of an
ANDcan't be converted,to_iceberg_and_predicatekeeps only the other side. That is sound forInexactpushdown because the result is implied by the filter.NOTthen negated it, producing a predicate that drops matching rows:NOT (a = 1 AND upper(b) = 'X')was pushed asNOT (a = 1).This adds a
TransformedResult::PartialPredicatevariant for predicates that are implied by the expression but not equivalent to it:ANDreturns it when it drops an operand.ANDandORpropagate it from their operands.NOTdoes not convert it, so the negated filter is not pushed down.A partial predicate that is not under a
NOTis pushed down as before.This mainly affects direct callers of
convert_filters_to_predicateand filters that reach it unsimplified; DataFusion's optimizer usually rewritesNOT (A AND B)before pushdown.The cast and bind changes originally in this PR were removed: #91 already fixed the cast handling on
main(#36), and the bind check is handled separately in #105.No public API or dependency changes.
AI assistance: OpenAI Codex assisted with implementation and tests.