You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by "tjbanghart (via GitHub)" <gi...@apache.org> on 2024/11/22 21:55:11 UTC
[PR] [CALCITE-6688] Allow basic symmetric operators to be reversed. [calcite]
tjbanghart opened a new pull request, #4062:
URL: https://github.com/apache/calcite/pull/4062
`SqlBasicFunction` did not override `SqlOperator#reverse()` so functions belonging to the `SqlKind.SYMMETRICAL` set threw a NPE [during normalization](https://github.com/apache/calcite/blob/8b4136bbd183f10e72c2ec02bef9caf1748631c2/core/src/main/java/org/apache/calcite/rex/RexNormalize.java#L102).
This PR adds a overridden `reverse()` method to `SqlBasicFunction` that returns the operator if `isSymmetrical()` is true.
--
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-6688] Allow symmetric basic functions to be reversed. [calcite]
Posted by "tjbanghart (via GitHub)" <gi...@apache.org>.
tjbanghart commented on PR #4062:
URL: https://github.com/apache/calcite/pull/4062#issuecomment-2494936700
Could you suggest another good test class to add to? There are some in `core/src/test/java/org/apache/calcite/rex/RexNormalizeTest.java`
--
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-6688] Allow operators of SqlKind.SYMMETRICAL to be reversed. [calcite]
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #4062:
URL: https://github.com/apache/calcite/pull/4062#issuecomment-2512874782
## [](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=4062) **Quality Gate passed**
Issues
 [0 New issues](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=4062&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=4062&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_calcite&pullRequest=4062&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [66.7% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=4062&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=4062&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=4062)
--
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-6688] Allow operators of SqlKind.SYMMETRICAL to be reversed. [calcite]
Posted by "NobiGo (via GitHub)" <gi...@apache.org>.
NobiGo commented on code in PR #4062:
URL: https://github.com/apache/calcite/pull/4062#discussion_r1868830959
##########
core/src/test/java/org/apache/calcite/test/RelBuilderTest.java:
##########
@@ -5512,6 +5515,28 @@ private static RelNode buildCorrelateWithJoin(JoinRelType type, RelBuilder build
"empid=150; name=Sebastian");
}
+ /** Test case for
+ * <a href="https://issues.apache.org/jira/browse/CALCITE-6688">[CALCITE-6688]
+ * Allow operators of SqlKind.SYMMETRICAL to be reversed</a>. */
Review Comment:
The commit info should be consistent with Jira's summary.
--
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-6688] Allow operators of SqlKind.SYMMETRICAL to be reversed. [calcite]
Posted by "tjbanghart (via GitHub)" <gi...@apache.org>.
tjbanghart commented on code in PR #4062:
URL: https://github.com/apache/calcite/pull/4062#discussion_r1869976358
##########
core/src/test/java/org/apache/calcite/test/RelBuilderTest.java:
##########
@@ -5512,6 +5515,28 @@ private static RelNode buildCorrelateWithJoin(JoinRelType type, RelBuilder build
"empid=150; name=Sebastian");
}
+ /** Test case for
+ * <a href="https://issues.apache.org/jira/browse/CALCITE-6688">[CALCITE-6688]
+ * Allow operators of SqlKind.SYMMETRICAL to be reversed</a>. */
Review Comment:
Done.
--
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-6688] Allow operators of SqlKind.SYMMETRICAL to be reversed. [calcite]
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #4062:
URL: https://github.com/apache/calcite/pull/4062#issuecomment-2518104199
## [](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=4062) **Quality Gate passed**
Issues
 [0 New issues](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=4062&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=4062&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_calcite&pullRequest=4062&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [66.7% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=4062&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=4062&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=4062)
--
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-6688] Allow operators of SqlKind.SYMMETRICAL to be reversed [calcite]
Posted by "tjbanghart (via GitHub)" <gi...@apache.org>.
tjbanghart commented on PR #4062:
URL: https://github.com/apache/calcite/pull/4062#issuecomment-2518999047
Thank you both for the review @NobiGo, @mihaibudiu!
--
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-6688] Allow symmetric basic functions to be reversed. [calcite]
Posted by "mihaibudiu (via GitHub)" <gi...@apache.org>.
mihaibudiu commented on PR #4062:
URL: https://github.com/apache/calcite/pull/4062#issuecomment-2494935497
You need some unit tests.
You should reconcile the JIRA title with this one.
--
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-6688] Allow symmetrical SqlBasicFunctions functions to be reversed. [calcite]
Posted by "mihaibudiu (via GitHub)" <gi...@apache.org>.
mihaibudiu commented on PR #4062:
URL: https://github.com/apache/calcite/pull/4062#issuecomment-2494939870
It would be great to have a test that reproduces the NPE that is mentioned in the JIRA issue.
--
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-6688] Allow operators of SqlKind.SYMMETRICAL to be reversed. [calcite]
Posted by "mihaibudiu (via GitHub)" <gi...@apache.org>.
mihaibudiu commented on PR #4062:
URL: https://github.com/apache/calcite/pull/4062#issuecomment-2518237171
@NobiGo I will let you approve and merge this when you think you are happy with the requested changes.
--
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-6688] Allow operators of SqlKind.SYMMETRICAL to be reversed [calcite]
Posted by "NobiGo (via GitHub)" <gi...@apache.org>.
NobiGo merged PR #4062:
URL: https://github.com/apache/calcite/pull/4062
--
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