You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Zoltan Haindrich (Jira)" <ji...@apache.org> on 2020/11/12 17:07:00 UTC

[jira] [Commented] (CALCITE-4398) RexSimplify introduces cast(nullable as nonnull)

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

Zoltan Haindrich commented on CALCITE-4398:
-------------------------------------------

this is incorrect; at most it could be:
{code}
IS NOT NULL(IS TRUE(>=(?0.int1, 0)))
{code}
which could be further rewritten to {{TRUE}} ; because {{IS TRUE(>=(?0.int1, 0))}} may never 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)