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

Zoltan Haindrich commented on CALCITE-2247:
-------------------------------------------

[~julianhyde] I've missed that - I was clearly not thinking in 3 valued logic 
correctly.

Currently (b=1 OR b!=1) is simplified to (b=1 OR b is not null) which is 
somewhat ok; better would be to simplify that to (b is not null) but I haven't 
figured out how to do that without doing another pass...I will keep thinking 
about it...I've updated the PR with the fix ; and some minor unknown related 
changes.

There was one 
[test|https://github.com/apache/calcite/pull/688/commits/438f90eed88831abe32909ad93abbd7c678cb88f#diff-9f6a8f13d9ad70d7336340bf6b2e7b71R415]
 in which I think the removal of null was inappropriate; because having a 
{{null}} in an OR limits its output to be only unknown or true; but never 
false. Let me know if I'm wrong!

> 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)

Reply via email to