Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-4366

case expression referencing columns[..] = literal fails to resolve to tru

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.4.0
    • None
    • SQL Parser
    • None

    Description

      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

      Attachments

        1. TBINT.tbl
          0.0 kB
          N Campbell
        2. BADLEN.png
          57 kB
          N Campbell

        Activity

          People

            Unassigned Unassigned
            the6campbells N Campbell
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: