You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2022/12/05 15:05:30 UTC

[GitHub] [calcite] libenchao commented on a diff in pull request #2847: [CALCITE-5141] Incomplete implicit type conversion for insert values

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: commits-unsubscribe@calcite.apache.org

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