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-unsubscr...@ignite.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to