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/06 00:39:36 UTC

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

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


##########
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:
   Yes, true means coercion has occurred, and so do `coerceOperandType`. 



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