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

Danny Chen commented on CALCITE-4364:
-------------------------------------

Julian, can you take a look again, i expanded the sarg fix logic as:

# A Sarg has complexity greater than 1;
# The terms are reduced as simpler Sarg points.

Compared to before, more sargs can be merged.

> "a in (1, 2) and a = 1" should be simplified 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: Liya Fan
>            Priority: Major
>             Fix For: 1.27.0
>
>
> 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)

Reply via email to