Deepak Kapoor
2018-08-23 23:18:21 UTC
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 (***@mapr.com <mailto:***@mapr.com>)
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 (***@mapr.com <mailto:***@mapr.com>)