fix(optimizer): preserve right join filters [CODEX] - #7965
Closed
dev-willbird1936 wants to merge 2 commits into
Closed
fix(optimizer): preserve right join filters [CODEX]#7965dev-willbird1936 wants to merge 2 commits into
dev-willbird1936 wants to merge 2 commits into
Conversation
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.
Direct or unisolated
RIGHT JOINpredicates that reference only the preservedright-side relation must not move from
WHEREintoON. The rewrite changesSQL semantics because rows that fail the predicate become unmatched preserved
rows and survive the join.
This patch keeps those filters after the join. It still pushes deterministic,
right-side-local predicates into the simple isolated source produced by table
isolation. It rejects unsafe derived sources, volatile expressions, and unsafe
later join shapes. The regression covers the affected boundary and nearby
safe behavior.
Issue #873 and PR #875 are related prior art, not duplicates. They addressed
left/non-preserved pushdown below a
RIGHT JOINand deliberately preservedsafe isolated right-side selection. Separate confirmed
ON-originRIGHT/FULLvariants and theFULL JOINleft-sideWHEREvariant areoutside this PR and are not claimed fixed.
This patch is based on
33de21fc21cdc05755a2de39318b292c10ccec0fand ends ata303d120977930c25110c72b09454348fe793f2d.Closes #7964.
OpenAI Codex was used to help analyze the bug, implement the fix, and validate
the tests. Commit authorship and subjects contain no AI credit.