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.



Jira Link
Pending issue creation and linkage. This PR is a draft.
Changes Proposed
A SEMI JOIN with a singleton left input currently becomes a filter and projection over the right input. If several right rows match, the rewrite returns the left row once per match instead of once overall.
Exclude SEMI joins from the left-singleton simplification, including the Project-over-Values variant. Add regressions for both shapes. Right-singleton SEMI joins retain their existing optimization.
Reproduction
Join left
VALUES (1)to rightVALUES (1), (1)with a SEMI equality join. The original join returns one row; the affected rewrite returns two.Validation
./gradlew autostyleApplyandgit diff --checkpass.mainwas blocked byjava.io.IOException: No space left on device; the full Gradle build has not been validated locally.Downsides
This disables the invalid simplification for left-singleton SEMI joins. A separate existence-preserving rewrite could recover that optimization later.