[
https://issues.apache.org/jira/browse/CALCITE-2247?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16481312#comment-16481312
]
Jesus Camacho Rodriguez commented on CALCITE-2247:
--------------------------------------------------
When {{unknownAsFalse}} was introduced in some of RexUtil methods, it was not
meant to be a global property for the whole simplification phase as it is
currently in RexSimplify. Instead, it was a value passed selectively down by
some methods that could help triggering some additional optimizations, e.g.,
for CASE statements, that are not correct when we consider 3-value logic. That
was intentional, e.g., you can see that the original implementation was not
passing the property through NOT clause. It seems to me that setting the
property globally for RexSimplify is what has caused the issues that are
described above, e.g., for simplifyNot method.
I do not think that rewriting that logic without the context information (call
it {{unknownAsFalse}} or {{withinIsTrueExpr}}) and preserving the same coverage
to simplify expressions is trivial/possible, but I may be 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)