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

Zoltan Haindrich commented on CALCITE-2840:
-------------------------------------------

Sorry for the unclear summary; I've rephrased it - in this case may was a bad 
choice.

What I have in mind is that we are "carefully" setting UnknownAs to UNKNOWN 
during and/or operand simplification; so that the following test is not passing 
- because even if the expression is in UnknownAs.FALSE mode the "and" at the 
bottom will be evaluating in UNKNOWN
{code}
  @Test public void testSimplifyAnd4() {
    checkSimplify2(
        and(
            eq(vInt(2), literal(2)),
            or(
                eq(vInt(3), literal(3)),
                and(
                    ge(vInt(), literal(1)),
                    le(vInt(), literal(1))))),
        "AND(=(?0.int2, 2), OR(=(?0.int3, 3), AND(>=(?0.int0, 1), <=(?0.int0, 
1))))",
        "AND(=(?0.int2, 2), OR(=(?0.int3, 3), =(?0.int0, 1)))"

    );
  }
{code}

There could be other cases; the important in this is that the dependent 
simplification logic relies on the unknownAs mode.

> Simplification should use more specific UnknownAs modes during simplification
> -----------------------------------------------------------------------------
>
>                 Key: CALCITE-2840
>                 URL: https://issues.apache.org/jira/browse/CALCITE-2840
>             Project: Calcite
>          Issue Type: Improvement
>            Reporter: Zoltan Haindrich
>            Assignee: Zoltan Haindrich
>            Priority: Major
>
> Some parts of this was already working in 1.17 ; but 1.18 turned out to be a 
> more conservative in this sense.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to