You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by "Khurram Faraaz (JIRA)" <ji...@apache.org> on 2016/11/10 11:13:58 UTC
[jira] [Created] (DRILL-5029) need better error - cast interval day
to int or bigint
Khurram Faraaz created DRILL-5029:
-------------------------------------
Summary: need better error - cast interval day to int or bigint
Key: DRILL-5029
URL: https://issues.apache.org/jira/browse/DRILL-5029
Project: Apache Drill
Issue Type: Bug
Components: Execution - Flow
Affects Versions: 1.8.0
Reporter: Khurram Faraaz
Priority: Minor
We need a better error message, today Drill returns an AssertionError
{noformat}
0: jdbc:drill:schema=dfs.tmp> values(cast('P162M24D' as INTERVAL DAY));
+---------+
| EXPR$0 |
+---------+
| P24D |
+---------+
1 row selected (0.419 seconds)
{noformat}
A better error would be
ERROR: cannot cast type interval to int
{noformat}
0: jdbc:drill:schema=dfs.tmp> values(cast(cast('P162M24D' as INTERVAL DAY) as INT));
Error: SYSTEM ERROR: AssertionError: Internal error: Conversion to relational algebra failed to preserve datatypes:
validated type:
RecordType(INTEGER NOT NULL EXPR$0) NOT NULL
converted type:
RecordType(BIGINT NOT NULL EXPR$0) NOT NULL
rel:
LogicalProject(EXPR$0=[/INT(Reinterpret(CAST('P162M24D'):INTERVAL DAY NOT NULL), 86400000)])
LogicalValues(tuples=[[{ 0 }]])
[Error Id: 662716fb-c2c3-4032-8d92-835f8b0ec7ae on centos-01.qa.lab:31010] (state=,code=0)
{noformat}
A better message would be
ERROR: cannot cast type interval to bigint
{noformat}
0: jdbc:drill:schema=dfs.tmp> values(cast(cast('P162M24D' as INTERVAL DAY) as BIGINT));
Error: SYSTEM ERROR: AssertionError: todo: implement syntax SPECIAL(Reinterpret(CAST('P162M24D'):INTERVAL DAY NOT NULL))
[Error Id: ef2c31cd-dee3-4f13-aca0-05c16185f789 on centos-01.qa.lab:31010] (state=,code=0)
{noformat}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)