You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Igor Lozynskyi (Jira)" <ji...@apache.org> on 2020/10/10 09:54:00 UTC
[jira] [Updated] (CALCITE-4325) RexSimplify/Sarg incorrectly
simplifies complex expressions with NULL
[ https://issues.apache.org/jira/browse/CALCITE-4325?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Igor Lozynskyi updated CALCITE-4325:
------------------------------------
Description:
In Calcite 1.26, the Rex expressions like follows:
{code:java}
(deptno = 20 OR deptno IS NULL) AND deptno = 10{code}
Are simplified to:
{code:java}
deptno IS NULL{code}
Instead of:
{code:java}
FALSE{code}
Similarly, the following expression:
{code:java}
(deptno <> 20 OR deptno IS NULL) AND deptno = 10{code}
Is simplified to:
{code:java}
deptno = 10 OR deptno IS NULL{code}
Instead of:
{code:java}
deptno = 10{code}
A diff with related unit tests (for RelBuilderTest.java) is in the attachment.
was:
In Calcite 1.26, the Rex expressions like follows:
`(deptno = 20 OR deptno IS NULL) AND deptno = 10`
Are simplified to:
`deptno IS NULL`
Instead of:
`FALSE`
Similarly, the following expression:
`(deptno <> 20 OR deptno IS NULL) AND deptno = 10`
Is simplified to:
`deptno = 10 OR deptno IS NULL`
Instead of:
`deptno = 10`
A diff with related unit tests (for RelBuilderTest.java) is in the attachment.
> RexSimplify/Sarg incorrectly simplifies complex expressions with NULL
> ---------------------------------------------------------------------
>
> Key: CALCITE-4325
> URL: https://issues.apache.org/jira/browse/CALCITE-4325
> Project: Calcite
> Issue Type: Bug
> Components: core
> Affects Versions: 1.26.0
> Environment: All environments
> Reporter: Igor Lozynskyi
> Priority: Major
> Attachments: rex-simplify-issue-tests.patch
>
>
> In Calcite 1.26, the Rex expressions like follows:
> {code:java}
> (deptno = 20 OR deptno IS NULL) AND deptno = 10{code}
> Are simplified to:
> {code:java}
> deptno IS NULL{code}
> Instead of:
> {code:java}
> FALSE{code}
> Similarly, the following expression:
> {code:java}
> (deptno <> 20 OR deptno IS NULL) AND deptno = 10{code}
> Is simplified to:
> {code:java}
> deptno = 10 OR deptno IS NULL{code}
> Instead of:
> {code:java}
> deptno = 10{code}
> A diff with related unit tests (for RelBuilderTest.java) is in the attachment.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)