[ https://issues.apache.org/jira/browse/CALCITE-2247?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16467823#comment-16467823 ]
Julian Hyde commented on CALCITE-2247: -------------------------------------- [~kgyrtkirk], I reviewed, and pushed a branch with some fix up and a new test case: https://github.com/julianhyde/calcite/tree/2247-simplify. You are probably thinking in terms of 2-valued logic, i.e. "unknown-as-false", but RexSimplify is used for 3-valued logic. It is not valid to simplify "b = 1 OR b <> 1" to true if b may be null (if you have have set RexSimplify.unnkownAsFalse(false)). I tried fixing by wrapping with "IS_NOT_FALSE" rather than "NOT", but was defeated because the necessary simplification of IS_NOT_FALSE was not happening. With your changes, RexSimplify.simplifyIs does not always call simplifyIs2. Can you revisit and make sure that the new test case passes. > 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)