Khurram Faraaz created DRILL-4936:
-------------------------------------
Summary: case expression when true then null, fails
Key: DRILL-4936
URL: https://issues.apache.org/jira/browse/DRILL-4936
Project: Apache Drill
Issue Type: Bug
Components: Execution - Flow
Affects Versions: 1.9.0
Reporter: Khurram Faraaz
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
{noformat}
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)
{noformat}
{noformat}
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)
{noformat}
from Postgres 9.3
{noformat}
postgres=# select (case when true then null else null end) from (values(1)) foo;
case
------
(1 row)
{noformat}
{noformat}
postgres=# select (case when true then null end) from (values(1)) foo;
case
------
(1 row)
{noformat}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)