You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Julian Hyde (Jira)" <ji...@apache.org> on 2020/08/23 23:39:00 UTC

[jira] [Commented] (CALCITE-4190) OR simplification incorrectly loses term

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

Julian Hyde commented on CALCITE-4190:
--------------------------------------

I introduced this in CALCITE-4159 or CALCITE-4170, when I made {{Predicate.allowedInOr}} call {{isEffectivelyNotNull}}. It caused a term to be visited in both the first and second loop of simplification; the second simplification assumed "not term" as a predicate, and therefore "proved" that the term was false.

There is a [candidate fix|https://github.com/julianhyde/calcite/tree/4190-simplify].

> OR simplification incorrectly loses term
> ----------------------------------------
>
>                 Key: CALCITE-4190
>                 URL: https://issues.apache.org/jira/browse/CALCITE-4190
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Julian Hyde
>            Priority: Major
>
> Simplification of OR expressions incorrectly loses a term. For example,
> {code}(0 < a and a <= 10) or a is null or (8 < a and a < 12) or a >= 15{code}
> is simplified to
> {code}as is null or (0 < a and a <= 10) or (8 < a and a < 12){code}
> (Moving {{a is null}} to the front is expected, but removing {{a >= 15}} is wrong.)



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