[ 
https://issues.apache.org/jira/browse/CALCITE-4398?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17230893#comment-17230893
 ] 

Vladimir Sitnikov commented on CALCITE-4398:
--------------------------------------------

{{?0.int1}} is nullable, so {{>=(?0.int1, 0)}} could be {{null}}.

> RexSimplify introduces cast(nullable as nonnull)
> ------------------------------------------------
>
>                 Key: CALCITE-4398
>                 URL: https://issues.apache.org/jira/browse/CALCITE-4398
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.26.0
>            Reporter: Vladimir Sitnikov
>            Priority: Major
>
> {noformat}
> isNotNull(case_(case_(trueLiteral, isFalse(lt(vInt(1), literal(0))), 
> trueLiteral), trueLiteral, falseLiteral))
> {noformat}
> is optimized to
> {noformat}IS NOT NULL(CAST(>=(?0.int1, 0)):BOOLEAN NOT NULL){noformat}
> which looks strange, since it casts nullable value to a non-null type.
> /cc [~kgyrtkirk]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to