N Campbell created DRILL-4366:
---------------------------------

             Summary: 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


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)

Reply via email to