mihaibudiu commented on code in PR #4353:
URL: https://github.com/apache/calcite/pull/4353#discussion_r2082775585
##########
core/src/main/java/org/apache/calcite/sql/validate/implicit/TypeCoercion.java:
##########
@@ -129,10 +129,27 @@ boolean rowTypeCoercion(
/**
* Coerces CASE WHEN statement branches to one common type.
*
- * <p>Rules: Find common type for all the then operands and else operands,
- * then try to coerce the then/else operands to the type if needed.
+ * @deprecated Use {@link #caseOrEquivalentCoercion} instead.
*/
- boolean caseWhenCoercion(SqlCallBinding binding);
+ @Deprecated boolean caseWhenCoercion(SqlCallBinding binding);
+
+ /**
+ * Type coercion in CASE WHEN, COALESCE, and NULLIF.
+ *
+ * <p>Rules:
+ * <ol>
+ * <li>
+ * CASE WHEN 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.</li>
+ * <li>
+ * COALESCE collect all the branches types to find a common type,
+ * then cast the operands to the common type when needed.</li>
+ * <li>
+ * NULLIF return type is the first operand type, with no coercion
applied.</li>
Review Comment:
made nullable if necessary
--
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]