-
Notifications
You must be signed in to change notification settings - Fork 2.5k
[CALCITE-5756] Expand ProjectJoinRemoveRule to support inner join remove by the foreign-unique constraint in the catalog #3264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
core/src/main/java/org/apache/calcite/rel/metadata/BuiltInMetadata.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/apache/calcite/rel/metadata/BuiltInMetadata.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/apache/calcite/rel/metadata/BuiltInMetadata.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/apache/calcite/rel/metadata/RelMdForeignKeys.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/apache/calcite/rel/metadata/RelMdForeignKeys.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/apache/calcite/rel/metadata/RelMdForeignKeys.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/apache/calcite/rel/metadata/RelMdForeignKeys.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/apache/calcite/rel/metadata/RelMdForeignKeys.java
Show resolved
Hide resolved
core/src/main/java/org/apache/calcite/rel/metadata/RelMdForeignKeys.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/apache/calcite/rel/metadata/RelMdForeignKeys.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/apache/calcite/rel/metadata/RelMdForeignKeys.java
Show resolved
Hide resolved
core/src/main/java/org/apache/calcite/rel/metadata/RelMetadataQuery.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/apache/calcite/rel/metadata/RelMetadataQuery.java
Outdated
Show resolved
Hide resolved
testkit/src/main/java/org/apache/calcite/test/catalog/MockCatalogReaderSimple.java
Show resolved
Hide resolved
testkit/src/main/java/org/apache/calcite/test/catalog/MockCatalogReaderSimple.java
Show resolved
Hide resolved
testkit/src/main/java/org/apache/calcite/test/catalog/MockCatalogReaderSimple.java
Show resolved
Hide resolved
core/src/main/java/org/apache/calcite/rel/rules/ProjectJoinRemoveRule.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/apache/calcite/rel/rules/ProjectJoinRemoveRule.java
Show resolved
Hide resolved
core/src/main/java/org/apache/calcite/rel/rules/ProjectJoinRemoveRule.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/apache/calcite/rel/rules/ProjectJoinRemoveRule.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/apache/calcite/rel/rules/ProjectJoinRemoveRule.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/apache/calcite/rel/rules/ProjectJoinRemoveRule.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/apache/calcite/rel/rules/ProjectJoinRemoveRule.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/apache/calcite/rel/rules/ProjectJoinRemoveRule.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/apache/calcite/rel/rules/ProjectJoinRemoveRule.java
Outdated
Show resolved
Hide resolved
testkit/src/main/java/org/apache/calcite/test/RelMetadataFixture.java
Outdated
Show resolved
Hide resolved
testkit/src/main/java/org/apache/calcite/test/RelMetadataFixture.java
Outdated
Show resolved
Hide resolved
core/src/test/java/org/apache/calcite/test/RelMetadataTest.java
Outdated
Show resolved
Hide resolved
core/src/test/java/org/apache/calcite/test/RelMetadataTest.java
Outdated
Show resolved
Hide resolved
Thanks @JingDas, I will review again as soon as I have some time. In the meantime, I have approved the pending workflows, but I have also noticed that there are 18 code smells detected by SonarCloud, could you do a pass on this list and fix whatever can be reasonably fixed? As for any automatic tool not everything makes sense and there might even be false positives. |
|
|
Sorry, it was closed by mistake,I reopen it and fixed the most necessary SonarCloud detected code. |
|
I some confusion about the failed results of the CI tests. In RelOptFixture.java:397 it throw the exception. |
|
Aha! It seems calcite main code change, And the CI seems to use the new main logic. I will fix it according to main code usage. |
Have fixed it. |
…ove by the foreign-unique constraint in the catalog
|
Kudos, SonarCloud Quality Gate passed! |
|
This PR was approved, but never merged. What's the plan? |
asolimando
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mihaibudiu, discussion in the associated Jira ticket led to creating CALCITE-5881, which needs to be addressed before getting this in, unfortunately there was no progress on it for a long time now. I will remove the approval to make the situation clearer, thanks for the reminder.
|
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 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 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 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 feature is mainly about expanding ProjectJoinRemoveRule to support inner join remove
by the foreign-unique constraint in the catalog.
The main steps are as follows:
RelMetadataQuery#getForeignKeys(newly add, similar to RelMetadataQuery#getUniqueKeys),
RelOptTable#getReferentialConstraints.
Test cases are added to RelOptRulesTest and RelMetadataTest.