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 2018/10/15 14:12:00 UTC

[jira] [Commented] (CALCITE-1289) RexUtil.simplifyCase() should account for nullability

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

Zoltan Haindrich commented on CALCITE-1289:
-------------------------------------------

I was looking into these casts around case expressions; and I think the original simplification was not entirely correct by rewriting that case to just {{CONDITION}} - I think the right rewrite would have been {{CONDITION IS TRUE}} ; which would be already 2 valued :)

> RexUtil.simplifyCase() should account for nullability
> -----------------------------------------------------
>
>                 Key: CALCITE-1289
>                 URL: https://issues.apache.org/jira/browse/CALCITE-1289
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>            Reporter: MinJi Kim
>            Assignee: Julian Hyde
>            Priority: Major
>             Fix For: 1.9.0
>
>
> RexUtil.simplify() returns incorrect type information if the RexNode is a CASE(CONDITION, TRUE, FALSE).  In this case, the CASE RexNode is a Boolean with isNullable == false.  But, with the simplify, RexUtil.simplify returns CONDITION.  When CONDITION has isNullable == true, the returned RexNode does not match the row type and fails to transform  (vice versa).



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)