mihaibudiu commented on code in PR #4353:
URL: https://github.com/apache/calcite/pull/4353#discussion_r2071932907
##########
core/src/main/java/org/apache/calcite/sql/validate/implicit/TypeCoercionImpl.java:
##########
@@ -382,12 +383,22 @@ protected boolean booleanEquality(SqlCallBinding binding,
return false;
}
+ @Deprecated @Override public boolean caseWhenCoercion(SqlCallBinding
callBinding) {
+ return caseOrEquivalentCoercion(callBinding);
+ }
+
/**
- * CASE and COALESCE type coercion, collect all the branches types including
then
+ * CASE WHEN and COALESCE type coercion, collect all the branches types
including then
* operands and else operands to find a common type, then cast the operands
to the common type
* when needed.
*/
- @Override public boolean caseWhenCoercion(SqlCallBinding callBinding) {
+ @Override public boolean caseOrEquivalentCoercion(SqlCallBinding
callBinding) {
+ if (!(callBinding.getCall() instanceof SqlCase)
Review Comment:
it is.
I think looking at the kind is more efficient too than calling instanceof
I favor positive checks == instead of !=, the meaning is unambiguous when
you refactor the code.
--
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]