danny0405 commented on a change in pull request #706: [CALCITE-2302] Implicit
type cast support
URL: https://github.com/apache/calcite/pull/706#discussion_r314589358
##########
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:
Thanks, i have updated the comments.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services