danny0405 commented on a change in pull request #2615:
URL: https://github.com/apache/calcite/pull/2615#discussion_r757834655



##########
File path: 
core/src/main/java/org/apache/calcite/sql/validate/implicit/TypeCoercionImpl.java
##########
@@ -104,14 +104,17 @@ public TypeCoercionImpl(RelDataTypeFactory typeFactory, 
SqlValidator validator)
       updateInferredColumnType(scope1, query, columnIndex, targetType);
       return true;
     case VALUES:
+      boolean coercedValues = true;
       for (SqlNode rowConstructor : ((SqlCall) query).getOperandList()) {
         if (!coerceOperandType(scope, (SqlCall) rowConstructor, columnIndex, 
targetType)) {
-          return false;
+          coercedValues = false;
         }
       }
-      updateInferredColumnType(
-          requireNonNull(scope, "scope"), query, columnIndex, targetType);
-      return true;
+      if (coercedValues) {
+        updateInferredColumnType(
+            requireNonNull(scope, "scope"), query, columnIndex, targetType);

Review comment:
       > org.opentest4j.AssertionFailedError: expected: <RecordType(VARCHAR 
EXPR$0) NOT NULL> 
   but was: <RecordType(VARCHAR NOT NULL EXPR$0) NOT NULL>
   
   Shouldn't this be the correct behavior ? Two constant literals are type 
nullable false, and implicit type coercion does not solve nullability 
in-consistency.




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to