[
https://issues.apache.org/jira/browse/CALCITE-2247?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16464209#comment-16464209
]
Julian Hyde commented on CALCITE-2247:
--------------------------------------
Can this change simplify {{a > 5 AND b < 2 AND a > 1}} to {{a > 5 AND b > 2}}?
(I.e. AND without the presence of OR. I believe it can.) If so, let's have a
test case for that.
I believe that it could also be easily extended to handle ORs. After the first
term, you know that the negation of the condition is true. For example, {{a <=
5 OR b <= 2 OR a <= 1}} can be simplified to {{a <= 5 OR b <= 2}} because after
the first term you know that {{a <= 5}} is not true. Therefore we can solve
CALCITE-2257, simplify {{x IS NULL OR x IS NOT NULL}} to true. The question is,
should we do that as part of this change?
> Add rule to push in condition condition into a related disjunctive expression
> -----------------------------------------------------------------------------
>
> Key: CALCITE-2247
> URL: https://issues.apache.org/jira/browse/CALCITE-2247
> Project: Calcite
> Issue Type: Improvement
> Reporter: Zoltan Haindrich
> Assignee: Zoltan Haindrich
> Priority: Major
>
> Simplify expressions like: {code}a = 1 AND (a = 1 OR a = 2){code} to {code}a
> = 1{code}
> Conditions to apply will be:
> * in an AND condition there exists a comparison(c) and an OR (o)
> * o and c only reference 1 variable
> See HIVE-19097 for more info.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)