Would you expect coalesce to return a result when none of the columns in 
coalesce exist in the parquet file ??

Query 1:
select coalesce(cert_statusdd,cert_status33) from dfs.`/tmp/parquetfiles`;
Error: SYSTEM ERROR: CompileException: Line 56, Column 27: Assignment 
conversion not possible from type 
“org.apache.drill.exec.expr.holders.NullableIntHolder” to type 
“org.apache.drill.exec.vector.UntypedNullHolder”

Fragment 1:0

[Error Id: 7b9193fb-289b-4fbf-a52a-2b93b01f0cd0 on dkvm2c:31010] (state=,code=0)

In above case both the columns do not exist.  Is the error reported a valid 
error or is it a bug.

Another observation is that if you use CAST on the column that does not exist, 
Coalesce will not error out instead return nulls. 
Query 2:
select coalesce(cast(cert_statusdd as varchar),cast(cert_statusee as varchar)) 
from dfs.`/tmp/parquetfiles` limit 3;
+---------+
| EXPR$0  |
+---------+
| null    |
| null    |
| null    |
+————+

Note: Databases like postgresql and mysql will not allow COALESCE on non 
existing column, w or without CAST. 
Drill however being schema free, do we expect COALESCE to succeed and give null 
as result ?? In which case the SYSTEM ERROR: CompileException with the 1st 
Quert  be a bug. ??

Thanks.
- Deepak ([email protected] <mailto:[email protected]>)

Reply via email to