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

[jira] [Updated] (DRILL-4366) case expression referencing columns[..] = literal fails to resolve to tru

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

N Campbell updated DRILL-4366:
------------------------------
    Attachment: BADLEN.png

Input file rows are terminated with crlf 

If there are additional columns i.e 1|-1|A then the length is 2 and not 3



> case expression referencing columns[..] = literal fails to resolve to tru
> -------------------------------------------------------------------------
>
>                 Key: DRILL-4366
>                 URL: https://issues.apache.org/jira/browse/DRILL-4366
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: SQL Parser
>    Affects Versions: 1.4.0
>            Reporter: N Campbell
>         Attachments: BADLEN.png
>
>
> A file (i.e PSV) has one or more columns with the string literal \N. A query that projects a conditional value based on testing the columns[N] being equal never results in true. Meanwhile comparing the same literal to the result of  a substring applied to the same column works. 
> SELECT columns[0] as RNUM, columns[1], case when substr(columns[1],1,2)= '\N' then 1 else 0 end ,case when columns[1]='\N' then 1 else 0 end  FROM `dfs`.`TEXT`.`./TBINT.tbl` LIMIT 100
> input file TBINT.tbl
> 0|\N
> 1|-1
> 2|0
> 3|1
> 4|10



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)