You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Oleg Zinoviev (JIRA)" <ji...@apache.org> on 2018/08/29 18:07:00 UTC

[jira] [Commented] (DRILL-6722) Query from parquet with case-then and arithmetic operation returns a wrong result

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

Oleg Zinoviev commented on DRILL-6722:
--------------------------------------

1) Bug can be reproduced without abs call
2) alias of case-then column has no affect on bug

> Query from parquet with case-then and arithmetic operation returns a wrong result
> ---------------------------------------------------------------------------------
>
>                 Key: DRILL-6722
>                 URL: https://issues.apache.org/jira/browse/DRILL-6722
>             Project: Apache Drill
>          Issue Type: Bug
>    Affects Versions: 1.14.0
>            Reporter: Oleg Zinoviev
>            Priority: Major
>         Attachments: correct.csv, result.csv
>
>
> Steps to reproduce:
> 1) Create sample table:
> {code:sql}
> create table dfs.tmp.test as 
>   select 1 as a, 2 as b
>   union all
>   select 3 as a, 2 as b
>   union all
>   select 1 as a, 4 as b
>   union all
>   select 2 as a, 2 as b
> {code}
> 2)  Execute query:
> {code:sql}
> select
>   case when s.a > s.b then s.a else s.b end as b, 
>   abs(s.a - s.b) as d
> from dfs.tmp.test s
> {code}
> 3) Drill returns:  [^result.csv] 
> 4) Result of query without parquet:
> {code:sql}
> select 
> 	case when s.a > s.b then s.a else s.b end as b, 
> 	abs(s.a - s.b) as d
> from (
> 	select 1 as a, 2 as b
> 	union all
> 	select 3 as a, 2 as b
> 	union all
> 	select 1 as a, 4 as b
> 	union all
> 	select 2 as a, 2 as b
> ) s
> {code}
>  [^correct.csv] 



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