caicancai commented on code in PR #4024:
URL: https://github.com/apache/calcite/pull/4024#discussion_r1824787569


##########
core/src/main/java/org/apache/calcite/sql/validate/implicit/AbstractTypeCoercion.java:
##########
@@ -274,9 +274,10 @@ protected boolean needToCast(SqlValidatorScope scope, 
SqlNode node,
       return false;
     }
 
-    // No need to cast between char and varchar.
+    // No need to cast between char and unlimited varchar.
     if (SqlTypeUtil.isCharacter(toType)
-        && SqlTypeUtil.isCharacter(fromType)) {
+        && SqlTypeUtil.isCharacter(fromType)
+        && toType.getPrecision() == RelDataType.PRECISION_NOT_SPECIFIED) {

Review Comment:
   @mihaibudiu   `Character`includes char, varchar, longvarchar, blob. Are 
these what you want? Will this have any impact?
   
   



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