[ https://issues.apache.org/jira/browse/CALCITE-2071?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16288206#comment-16288206 ]
Vineet Garg commented on CALCITE-2071: -------------------------------------- [~julianhyde] [~vvysotskyi] I have updated the patch to look for AND expressions. You can see the change at https://github.com/apache/calcite/compare/master...vineetgarg02:CALCITE-2071-my-attempt. Can you take a look? > Query with IN and OR in WHERE clause returns wrong result > --------------------------------------------------------- > > Key: CALCITE-2071 > URL: https://issues.apache.org/jira/browse/CALCITE-2071 > Project: Calcite > Issue Type: Bug > Reporter: Volodymyr Vysotskyi > Assignee: Julian Hyde > Fix For: 1.16.0 > > > Query in this test returns the wrong result (it returns empty result): > {code:java} > @Test > @Ignore > public void testWhereInOr() throws Exception { > CalciteAssert.hr() > .query("select \"empid\"\n" > + "from \"hr\".\"emps\" t\n" > + " where (\"empid\" in (select \"empid\" from > \"hr\".\"emps\") \n" > + " or \"empid\" in (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, " > + " 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, > 22, 23, 24, 25) )\n" > + " and \"empid\" in (100, 200, 150)") > .returns("empid=100\n" > + "empid=200\n" > + "empid=150\n"); > } > {code} > Without condition in {{or}} operator > {code:sql} > \"empid\" in (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, > 19, 20, 21, 22, 23, 24, 25) > {code} > it returns the right result. -- This message was sent by Atlassian JIRA (v6.4.14#64029)