NobiGo commented on code in PR #4403:
URL: https://github.com/apache/calcite/pull/4403#discussion_r2113057035
##########
core/src/main/java/org/apache/calcite/sql/SqlKind.java:
##########
@@ -662,6 +662,9 @@ public enum SqlKind {
/** {@code IS NOT NULL} operator. */
IS_NOT_NULL,
+ /** {@code CAST NOT NULL} operator. */
+ CAST_NOT_NULL,
Review Comment:
Duplicate A is not the issue that this PR needs to address. This needs to be
resolved in the Rel stage. This PR mainly addresses `COALESCE(a,b) -> CASE WHEN
a is not null THEN a ELSE b`. If a is nullable and b is not nullable, then
`COALESCE(a,b)` will be not nullable, while the type of `CASE WHEN a is not
null THEN a ELSE b` will be nullable. The main purpose here is to convert `CASE
WHEN a is not null a ELSE b` to `CASE WHEN a is not null THEN cast not null (a)
ELSE b`, converting this type to not nullable, to solve the problem of
inconsistent types mentioned in CALCITE-6978.
--
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]