You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Danny Chen (Jira)" <ji...@apache.org> on 2020/11/12 09:40:00 UTC

[jira] [Resolved] (CALCITE-4364) Simplify "a IN (1, 2) AND a = 1" to "a = 1"

     [ https://issues.apache.org/jira/browse/CALCITE-4364?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Danny Chen resolved CALCITE-4364.
---------------------------------
    Resolution: Fixed

Fixed in [5e9943a|https://github.com/apache/calcite/commit/5e9943aa1f51a97068fc37d53dea1d447570becc] ~

> Simplify "a IN (1, 2) AND a = 1" to "a = 1"
> -------------------------------------------
>
>                 Key: CALCITE-4364
>                 URL: https://issues.apache.org/jira/browse/CALCITE-4364
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.26.0
>            Reporter: Danny Chen
>            Assignee: Danny Chen
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.27.0
>
>          Time Spent: 7h
>  Remaining Estimate: 0h
>
> Calcite should simplify "\{{a IN (1, 2) AND a = 1}}" to "\{{a = 1}}". Check this test in {{RexProgramTest}}:
> {code:java}
> @Test void testSimplifyInAnd() {
>     // deptno in (20, 10) and deptno = 10
>     //   ==>
>     // deptno = 10
>     final RexNode e =
>         and(
>             in(vInt(), literal(20), literal(10)),
>             eq(vInt(), literal(10)));
>     checkSimplify(e, "=(?0.int0, 10)");
>   }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)