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

case expression when true then null, fails

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • 1.9.0
    • None
    • Execution - Flow
    • None

    Description

      Postgres compile and executes same query and returns null, whereas Drill returns error.

      Drill 1.9.0
      git commit id : 4edabe7a

      Drom Drill 1.9.0

      0: jdbc:drill:schema=dfs.tmp> select (case when true then null else null end) from (values(1));
      Error: VALIDATION ERROR: From line 1, column 9 to line 1, column 46: ELSE clause or at least one THEN clause must be non-NULL
      
      SQL Query null
      
      [Error Id: 2912d0b5-b947-4cd7-b325-83c809e5ae50 on centos-01.qa.lab:31010] (state=,code=0)
      
      0: jdbc:drill:schema=dfs.tmp> select (case when true then null end) from (values(1));
      Error: VALIDATION ERROR: From line 1, column 9 to line 1, column 36: ELSE clause or at least one THEN clause must be non-NULL
      
      SQL Query null
      
      [Error Id: cdb56929-b175-4474-b8a4-e6eec4d4a28f on centos-01.qa.lab:31010] (state=,code=0)
      

      from Postgres 9.3

      postgres=# select (case when true then null else null end) from (values(1)) foo;
       case
      ------
      
      (1 row)
      
      postgres=# select (case when true then null end) from (values(1)) foo;
       case
      ------
      
      (1 row)
      

      Attachments

        Issue Links

          Activity

            People

              sharnyk Serhii Harnyk
              khfaraaz Khurram Faraaz
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: