hsyuan commented on a change in pull request #706: [CALCITE-2302] Implicit type 
cast support
URL: https://github.com/apache/calcite/pull/706#discussion_r314537375
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/sql/fun/SqlCaseOperator.java
 ##########
 @@ -247,7 +248,22 @@ private RelDataType inferTypeFromValidator(
 
     RelDataType ret = callBinding.getTypeFactory().leastRestrictive(argTypes);
     if (null == ret) {
-      throw callBinding.newValidationError(RESOURCE.illegalMixingOfTypes());
+      boolean changed = false;
+      if (callBinding.getValidator().isTypeCoercionEnabled()) {
+        TypeCoercion typeCoercion = 
callBinding.getValidator().getTypeCoercion();
+        RelDataType commonType = typeCoercion.getWiderTypeFor(argTypes, true);
+        // commonType is with nullability as false.
 
 Review comment:
   The comment is confusing. Do you mean commonType is not nullable? or 
commonType doesn't have nullability property?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to