You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "zstan (via GitHub)" <gi...@apache.org> on 2024/12/16 12:11:13 UTC
[PR] IGNITE-23276 Sql. Clean up IgniteTypeCoercion [ignite-3]
zstan opened a new pull request, #4908:
URL: https://github.com/apache/ignite-3/pull/4908
Thank you for submitting the pull request.
To streamline the review process of the patch and ensure better code quality
we ask both an author and a reviewer to verify the following:
### The Review Checklist
- [ ] **Formal criteria:** TC status, codestyle, mandatory documentation. Also make sure to complete the following:
\- There is a single JIRA ticket related to the pull request.
\- The web-link to the pull request is attached to the JIRA ticket.
\- The JIRA ticket has the Patch Available state.
\- The description of the JIRA ticket explains WHAT was made, WHY and HOW.
\- The pull request title is treated as the final commit message. The following pattern must be used: IGNITE-XXXX Change summary where XXXX - number of JIRA issue.
- [ ] **Design:** new code conforms with the design principles of the components it is added to.
- [ ] **Patch quality:** patch cannot be split into smaller pieces, its size must be reasonable.
- [ ] **Code quality:** code is clean and readable, necessary developer documentation is added if needed.
- [ ] **Tests code quality:** test set covers positive/negative scenarios, happy/edge cases. Tests are effective in terms of execution time and resources.
### Notes
- [Apache Ignite Coding Guidelines](https://cwiki.apache.org/confluence/display/IGNITE/Java+Code+Style+Guide)
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-23276 Sql. Clean up IgniteTypeCoercion [ignite-3]
Posted by "ygerzhedovich (via GitHub)" <gi...@apache.org>.
ygerzhedovich commented on code in PR #4908:
URL: https://github.com/apache/ignite-3/pull/4908#discussion_r1890224799
##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/prepare/IgniteTypeCoercion.java:
##########
@@ -112,11 +89,6 @@ private boolean doBinaryComparisonCoercion(SqlCallBinding binding) {
validateBinaryComparisonCoercion(binding, leftType, rightType, (IgniteSqlValidator) validator);
- // If types are equal, no need in coercion.
- if (leftType.equals(rightType)) {
- return false;
- }
-
// Otherwise find the least restrictive type among the operand types
Review Comment:
Why previous part for equals types has been deleted - it looked like as fast path for such a case.
Even if it was a garbage need to amend the comment, due to it's strange to see 'Otherwise bla-bla-bla'.
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-23276 Sql. Clean up IgniteTypeCoercion [ignite-3]
Posted by "zstan (via GitHub)" <gi...@apache.org>.
zstan merged PR #4908:
URL: https://github.com/apache/ignite-3/pull/4908
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-23276 Sql. Clean up IgniteTypeCoercion [ignite-3]
Posted by "ygerzhedovich (via GitHub)" <gi...@apache.org>.
ygerzhedovich commented on code in PR #4908:
URL: https://github.com/apache/ignite-3/pull/4908#discussion_r1890238775
##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/prepare/IgniteTypeCoercion.java:
##########
@@ -150,78 +122,55 @@ private boolean doBinaryComparisonCoercion(SqlCallBinding binding) {
/** {@inheritDoc} */
@Override
public boolean binaryArithmeticCoercion(SqlCallBinding binding) {
- if (binding.getOperandCount() != 2 || !binding.getCall().isA(SqlKind.BINARY_ARITHMETIC)) {
- return false;
+ if (binding.getOperandCount() != 2) {
+ return super.binaryComparisonCoercion(binding);
}
RelDataType leftType = binding.getOperandType(0);
RelDataType rightType = binding.getOperandType(1);
- //noinspection SimplifiableIfStatement
- if (!typeFamiliesAreCompatible(typeFactory, leftType, rightType)) {
- return false;
- }
-
- return super.binaryArithmeticCoercion(binding);
+ return typeFamiliesAreCompatible(typeFactory, leftType, rightType) && super.binaryComparisonCoercion(binding);
Review Comment:
just my opinion - the previous code was easier to understand
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org