[ https://issues.apache.org/jira/browse/CALCITE-4364?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17227015#comment-17227015 ]
Julian Hyde commented on CALCITE-4364: -------------------------------------- I tried to understand the comment threads on the PR, and they are too long and forked. So, let's discuss here, and do not merge until we have consensus here. [~danny0405], Does the PR have lots of plan changes? I have been trying to avoid that in my previous work. Plan changes place a burden on downstream projects (e.g. if upgrading from 1.26 to 1.27 will require them to update 100 of their tests). It has been hard to thread that needle. We need to allow 'small sargs' during simplification, because small sargs can merge into larger ones that are simpler. But we have to expand the small sargs into comparisons in order to avoid plan changes. > "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)