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

[jira] [Updated] (CALCITE-4388) RexNode#isAlwaysFalse and isAlwaysTrue should be aligned with RexSimplify#isSafeExpression

     [ https://issues.apache.org/jira/browse/CALCITE-4388?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Vladimir Sitnikov updated CALCITE-4388:
---------------------------------------
    Description: 
{{(1/0) IS NULL}} should not result in {{isAlwaysFalse}}.
Currently, {{RexSimplify}} knows that 1/0 must not be simplified, however, {{isAlwaysTrue}} and {{isAlwaysFalse}} are still wrong.

That might result in wrong data, especially when the client code calls {{isAlways...}}

[~kgyrtkirk], I see you contributed a lot to simplification and {{SafeRexVisitor}}. Are you interested in improving {{isAlways...}}?

Sample issue:
{noformat}
isNull(case_(case_(trueLiteral, isTrue(vBool(1)), falseLiteral), isNotFalse(vBool(0)), trueLiteral))
isAlwaysFalse, so it should simplify to FALSE unknownAsFalse ==>
expected: <false>
but was: <IS NULL(OR(AND(CAST(?0.bool1):BOOLEAN NOT NULL, IS NOT FALSE(?0.bool0)), NOT(CAST(?0.bool1):BOOLEAN NOT NULL)))>
{noformat}

  was:
{{(1/0) IS NULL}} should not result in {{isAlwaysFalse}}.
Currently, {{RexSimplify}} knows that 1/0 must not be simplified, however, {{isAlwaysTrue}} and {{isAlwaysFalse}} are still wrong.

That might result in wrong data, especially when the client code calls {{isAlways...}}

[~kgyrtkirk], I see you contributed a lot to simplification and {{SafeRexVisitor}}. Are you interested in improving {{isAlways...}}?


> RexNode#isAlwaysFalse and isAlwaysTrue should be aligned with RexSimplify#isSafeExpression
> ------------------------------------------------------------------------------------------
>
>                 Key: CALCITE-4388
>                 URL: https://issues.apache.org/jira/browse/CALCITE-4388
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.26.0
>            Reporter: Vladimir Sitnikov
>            Priority: Major
>
> {{(1/0) IS NULL}} should not result in {{isAlwaysFalse}}.
> Currently, {{RexSimplify}} knows that 1/0 must not be simplified, however, {{isAlwaysTrue}} and {{isAlwaysFalse}} are still wrong.
> That might result in wrong data, especially when the client code calls {{isAlways...}}
> [~kgyrtkirk], I see you contributed a lot to simplification and {{SafeRexVisitor}}. Are you interested in improving {{isAlways...}}?
> Sample issue:
> {noformat}
> isNull(case_(case_(trueLiteral, isTrue(vBool(1)), falseLiteral), isNotFalse(vBool(0)), trueLiteral))
> isAlwaysFalse, so it should simplify to FALSE unknownAsFalse ==>
> expected: <false>
> but was: <IS NULL(OR(AND(CAST(?0.bool1):BOOLEAN NOT NULL, IS NOT FALSE(?0.bool0)), NOT(CAST(?0.bool1):BOOLEAN NOT NULL)))>
> {noformat}



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