You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Runkang He (Jira)" <ji...@apache.org> on 2023/06/07 00:47:00 UTC

[jira] [Updated] (CALCITE-5759) SEARCH operator with special sarg is not fully simplified

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

Runkang He updated CALCITE-5759:
--------------------------------
    Description: 
The minimal reproducer is to construct a RexCall with RexUnknownAs.FALSE as below:

{code:sql}
SEARCH(1, Sarg[IS NOT NULL])
{code}

After RexSimplify#simplifySearch, the final simplified result is IS NOT NULL(1), which should be TRUE more thoroughly.

Also, the following RexCall with RexUnknownAs.TRUE:
{code:sql}
SEARCH(1, Sarg[IS NULL])
{code}
Is simplified to IS NULL(1), which should be FALSE.

Note that current simplified result is inconsistent with RexCall.isAlwaysFalse and isAlwaysTrue.

Therefore, for the above two reasons, I think we need to simplify SEARCH operator with special sarg more thoroughly.

  was:
The minimal reproducer is to construct a RexCall with RexUnknownAs.FALSE as below:

{code:sql}
SEARCH(1, Sarg[IS NOT NULL])
{code}

After RexSimplify#simplifySearch, the final simplified result is IS NOT NULL(1), which should be TRUE more thoroughly.
Also, the following RexCall with RexUnknownAs.TRUE:
{code:sql}
SEARCH(1, Sarg[IS NULL])
{code}
Is simplified to IS NULL(1), which should be FALSE.
Note that current simplified result is inconsistent with RexCall.isAlwaysFalse and isAlwaysTrue.
Therefore, for the above two reasons, I think we need to simplify SEARCH operator with special sarg more thoroughly.


> SEARCH operator with special sarg is not fully simplified
> ---------------------------------------------------------
>
>                 Key: CALCITE-5759
>                 URL: https://issues.apache.org/jira/browse/CALCITE-5759
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 1.34.0
>            Reporter: Runkang He
>            Priority: Major
>
> The minimal reproducer is to construct a RexCall with RexUnknownAs.FALSE as below:
> {code:sql}
> SEARCH(1, Sarg[IS NOT NULL])
> {code}
> After RexSimplify#simplifySearch, the final simplified result is IS NOT NULL(1), which should be TRUE more thoroughly.
> Also, the following RexCall with RexUnknownAs.TRUE:
> {code:sql}
> SEARCH(1, Sarg[IS NULL])
> {code}
> Is simplified to IS NULL(1), which should be FALSE.
> Note that current simplified result is inconsistent with RexCall.isAlwaysFalse and isAlwaysTrue.
> Therefore, for the above two reasons, I think we need to simplify SEARCH operator with special sarg more thoroughly.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)