libenchao commented on code in PR #2847:
URL: https://github.com/apache/calcite/pull/2847#discussion_r1039714710


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

Review Comment:
   Could you help me to understand the meaning of return value for 
`rowTypeCoercion`? Per my understanding, `true` means coercion has occurred, 
right?



-- 
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