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

Julian Hyde edited comment on CALCITE-2071 at 12/14/17 7:16 PM:
----------------------------------------------------------------

In general quidem goes through more of the stack (e.g. uses JDBC) so is a more 
realistic test. In this case I think it was fairly random: the query against 
scott.EMP (a cached copy of a table initially read via the JDBC adapter) it 
happened to use an in-memory ArrayTable table that Calcite noticed was sorted, 
and therefore merge-join became an option. Whereas JdbcTest used "emps", a 
table consisting of Java objects read via reflection.

The better reason to use quidem is that tests are easier to write and maintain 
than java code, so we tend to have more test coverage.


was (Author: julianhyde):
In general quidem goes through more of the stack (e.g. uses JDBC) so is a more 
realistic test. In this case I think it was fairly random: the query against 
scott.EMP (a cached copy of a table initially read via the JDBC adapter) it 
happened to use an in-memory ArrayTable table that Calcite noticed was sorted, 
and therefore merge-join became an option. Whereas JdbcTest used "emps", a 
table consisting of Java objects read via reflection.

The better reason to use quidem is that it is easier to write and maintain than 
java code, so we tend to have more test coverage.

> 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)

Reply via email to