NobiGo commented on code in PR #3889:
URL: https://github.com/apache/calcite/pull/3889#discussion_r1696047758


##########
core/src/main/java/org/apache/calcite/sql/validate/implicit/AbstractTypeCoercion.java:
##########
@@ -258,7 +258,7 @@ protected boolean needToCast(SqlValidatorScope scope, 
SqlNode node,
     RelDataType fromType = validator.deriveType(scope, node);
     // This depends on the fact that type validate happens before coercion.
     // We do not have inferred type for some node, i.e. LOCALTIME.
-    if (fromType == null) {
+    if (fromType == null || fromType.getSqlTypeName() == SqlTypeName.NULL) {

Review Comment:
   @mihaibudiu Yes, I will check again. After this PR, some unit test behavior 
is unexpected.



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