You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by "Volodymyr Vysotskyi (JIRA)" <ji...@apache.org> on 2019/03/15 07:07:00 UTC

[jira] [Resolved] (DRILL-5683) Incorrect query result when query uses NOT(IS NOT NULL) expression

     [ https://issues.apache.org/jira/browse/DRILL-5683?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Volodymyr Vysotskyi resolved DRILL-5683.
----------------------------------------
       Resolution: Fixed
    Fix Version/s: 1.16.0

Fixed in DRILL-6524

> Incorrect query result when query uses NOT(IS NOT NULL) expression 
> -------------------------------------------------------------------
>
>                 Key: DRILL-5683
>                 URL: https://issues.apache.org/jira/browse/DRILL-5683
>             Project: Apache Drill
>          Issue Type: Bug
>            Reporter: Jinfeng Ni
>            Assignee: Volodymyr Vysotskyi
>            Priority: Major
>             Fix For: 1.16.0
>
>
> The following repo was modified from a testcase provided by Arjun Rajan(arajan@mapr.com).
> 1. Prepare dataset with null.
> {code}
> create table dfs.tmp.t1 as 
>   select r_regionkey, r_name, case when mod(r_regionkey, 3) > 0 then mod(r_regionkey, 3) else null end as flag 
>   from cp.`tpch/region.parquet`;
> select * from dfs.tmp.t1;
> +--------------+--------------+-------+
> | r_regionkey  |    r_name    | flag  |
> +--------------+--------------+-------+
> | 0            | AFRICA       | null  |
> | 1            | AMERICA      | 1     |
> | 2            | ASIA         | 2     |
> | 3            | EUROPE       | null  |
> | 4            | MIDDLE EAST  | 1     |
> +--------------+--------------+-------+
> {code}
> 2. Query with NOT(IS NOT NULL) expression in the filter. 
> {code}
> select * from dfs.tmp.t1 where NOT (flag IS NOT NULL);
> +--------------+---------+-------+
> | r_regionkey  | r_name  | flag  |
> +--------------+---------+-------+
> | 0            | AFRICA  | null  |
> | 3            | EUROPE  | null  |
> +--------------+---------+-------+
> {code}
> 3. Switch run-time code compiler from default to 'JDK', and get wrong result. 
> {code}
> alter system set `exec.java_compiler` = 'JDK';
> +-------+------------------------------+
> |  ok   |           summary            |
> +-------+------------------------------+
> | true  | exec.java_compiler updated.  |
> +-------+------------------------------+
> select * from dfs.tmp.t1 where NOT (flag IS NOT NULL);
> +--------------+--------------+-------+
> | r_regionkey  |    r_name    | flag  |
> +--------------+--------------+-------+
> | 0            | AFRICA       | null  |
> | 1            | AMERICA      | 1     |
> | 2            | ASIA         | 2     |
> | 3            | EUROPE       | null  |
> | 4            | MIDDLE EAST  | 1     |
> +--------------+--------------+-------+
> {code}
> 4.  Wrong result could happen too, when NOT(IS NOT NULL) in Project operator.
> {code}
> select r_regionkey, r_name, NOT(flag IS NOT NULL) as exp1 from dfs.tmp.t1;
> +--------------+--------------+-------+
> | r_regionkey  |    r_name    | exp1  |
> +--------------+--------------+-------+
> | 0            | AFRICA       | true  |
> | 1            | AMERICA      | true  |
> | 2            | ASIA         | true  |
> | 3            | EUROPE       | true  |
> | 4            | MIDDLE EAST  | true  |
> +--------------+--------------+-------+
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)