You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by "bvolpato (via GitHub)" <gi...@apache.org> on 2026/09/03 17:17:12 UTC
[PR] SEMI JOIN should not duplicate a singleton left row [calcite]
bvolpato opened a new pull request, #5241:
URL: https://github.com/apache/calcite/pull/5241
## 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 right `VALUES (1), (1)` with a SEMI equality join. The original join returns one row; the affected rewrite returns two.
```sh
./gradlew :core:test --tests 'org.apache.calcite.test.RelOptRulesTest.testSemiJoinWithConstantRowOnLeft' --tests 'org.apache.calcite.test.RelOptRulesTest.testSemiJoinWithProjectOnConstantRowOnLeft'
```
## Validation
- A compiled-source HepPlanner/Interpreter reproduction returns two rows before the fix and one after, for both left-side rule variants.
- Both right-side rule variants still optimize and preserve their results.
- Both exact planner regression methods pass against the checked-in XML snapshots and fail against the baseline rule.
- `./gradlew autostyleApply` and `git diff --check` pass.
- Focused runs used freshly compiled changed classes with cached supporting artifacts. Native Gradle test-class compilation on pristine `main` was blocked by `java.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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-7816] SEMI JOIN should not duplicate a singleton left row [calcite]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #5241:
URL: https://github.com/apache/calcite/pull/5241#issuecomment-6393096390
This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 90 days if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@calcite.apache.org list. Thank you for your contributions.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] SEMI JOIN should not duplicate a singleton left row [calcite]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #5241:
URL: https://github.com/apache/calcite/pull/5241#issuecomment-5529785707
## [](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=5241) **Quality Gate passed**
Issues
 [0 New issues](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=5241&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=5241&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_calcite&pullRequest=5241&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [100.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=5241&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=5241&metric=new_duplicated_lines_density&view=list)
<!-- sqra-placement-anchor -->
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=5241)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-7816] SEMI join simplification duplicates a singleton left row [calcite]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #5241:
URL: https://github.com/apache/calcite/pull/5241#issuecomment-6514933202
## [](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=5241) **Quality Gate passed**
Issues
 [0 New issues](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=5241&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=5241&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_calcite&pullRequest=5241&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [100.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=5241&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=5241&metric=new_duplicated_lines_density&view=list)
<!-- sqra-placement-anchor -->
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=5241)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-7816] SEMI join simplification duplicates a singleton left row [calcite]
Posted by "rubenada (via GitHub)" <gi...@apache.org>.
rubenada closed pull request #5241: [CALCITE-7816] SEMI join simplification duplicates a singleton left row
URL: https://github.com/apache/calcite/pull/5241
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-7816] SEMI join simplification duplicates a singleton left row [calcite]
Posted by "rubenada (via GitHub)" <gi...@apache.org>.
rubenada commented on PR #5241:
URL: https://github.com/apache/calcite/pull/5241#issuecomment-6519626848
I'm going to close this PR, since this fix has been covered already by https://github.com/apache/calcite/pull/5371
In any case, thanks for your work here @bvolpato !
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org