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/06 03:41:00 UTC

[jira] [Comment Edited] (CALCITE-4364) "a in (1, 2) and a = 1" should be simplified to "a=1"

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

Danny Chen edited comment on CALCITE-4364 at 11/6/20, 3:40 AM:
---------------------------------------------------------------

Thanks Julian ~
> Does the PR have lots of plan changes
No, at least from the tests of Calcite, there are no many plan diffs.

> But we have to expand the small sargs into comparisons in order to avoid plan changes

I agree, i can fix it together in this PR, but this would bring in many plan diffs because we already have many small Sargs in our plans.

I have updated the PR according your comments, please take a look if you have time, thanks so much ~


was (Author: danny0405):
Thanks Julian ~
> Does the PR have lots of plan changes
No, at least from the tests of Calcite, there are no many plan diffs.

> But we have to expand the small sargs into comparisons in order to avoid plan changes

I agree, i can fix it together in this PR, but this would bring in many plan diffs because we already have many small Sargs in our plans.

> "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
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.27.0
>
>          Time Spent: 5h 50m
>  Remaining Estimate: 0h
>
> 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)