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

[jira] [Updated] (DRILL-6524) Two CASE statements in projection influence results of each other

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

Volodymyr Vysotskyi updated DRILL-6524:
---------------------------------------
    Fix Version/s: 1.16.0

> Two CASE statements in projection influence results of each other
> -----------------------------------------------------------------
>
>                 Key: DRILL-6524
>                 URL: https://issues.apache.org/jira/browse/DRILL-6524
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Query Planning &amp; Optimization
>    Affects Versions: 1.11.0
>         Environment: Linux 3.10.0-693.21.1.el7.x86_64 #1 SMP Wed Mar 7 19:03:37 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux,
> NAME="CentOS Linux"
> VERSION="7 (Core)"
> apache drill 1.11.0, 
> openjdk version "1.8.0_171"
> OpenJDK Runtime Environment (build 1.8.0_171-b10)
> OpenJDK 64-Bit Server VM (build 25.171-b10, mixed mode)
>            Reporter: Oleksandr Chornyi
>            Assignee: Volodymyr Vysotskyi
>            Priority: Major
>             Fix For: 1.16.0
>
>
> h3. Steps to Reproduce
> Run the following query via {{sqlline}}:
> {code:sql}
> select
>   case when expr$0 = 3 then expr$0 else expr$1 end,
>   case when expr$0 = 1 then expr$0 else expr$1 end
> from (values(1, 2));
> {code}
> h4. Actual Results
> {noformat}
> +---------+---------+
> | EXPR$0  | EXPR$1  |
> +---------+---------+
> | 2       | 2       |
> +---------+---------+
> {noformat}
> h4. Expected Results
> {noformat}
> +---------+---------+
> | EXPR$0  | EXPR$1  |
> +---------+---------+
> | 2       | 1       |
> +---------+---------+
> {noformat}
> Note, that changing order of CASE statements fixes the issue. The following query yields correct results:
> {code:sql}
> select
>   case when expr$0 = 1 then expr$0 else expr$1 end,
>   case when expr$0 = 3 then expr$0 else expr$1 end
> from (values(1, 2));
> {code}



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