[
https://issues.apache.org/jira/browse/DRILL-3406?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Chris Westin updated DRILL-3406:
--------------------------------
Assignee: Daniel Barclay (Drill)
> Drill allows YEAR(10) but then disallows 10 digits
> --------------------------------------------------
>
> Key: DRILL-3406
> URL: https://issues.apache.org/jira/browse/DRILL-3406
> Project: Apache Drill
> Issue Type: Bug
> Components: Execution - Data Types
> Reporter: Daniel Barclay (Drill)
> Assignee: Daniel Barclay (Drill)
> Fix For: 1.2.0
>
>
> In interval literals, Drill allows specifying interval types with a leading
> field precision of 10, but then doesn't allow all 10-digit values. For
> example:
> {noformat}
> 0: jdbc:drill:zk=local> SELECT INTERVAL '2222222222' YEAR(10) FROM
> INFORMATION_SCHEMA.CATALOGS;
> Jun 26, 2015 2:13:53 PM org.apache.calcite.sql.validate.SqlValidatorException
> <init>
> SEVERE: org.apache.calcite.sql.validate.SqlValidatorException: Interval field
> value 2,222,222,222 exceeds precision of YEAR(10) field
> Jun 26, 2015 2:13:53 PM org.apache.calcite.runtime.CalciteException <init>
> SEVERE: org.apache.calcite.runtime.CalciteContextException: From line 1,
> column 9 to line 1, column 38: Interval field value 2,222,222,222 exceeds
> precision of YEAR(10) field
> Error: PARSE ERROR: From line 1, column 9 to line 1, column 38: Interval
> field value 2,222,222,222 exceeds precision of YEAR(10) field
> [Error Id: dea32980-c1ad-4d7c-9780-5a08714ffcb7 on dev-linux2:31010]
> (state=,code=0)
> 0: jdbc:drill:zk=local>
> {noformat}
> Note that the value does _not_ exceed the declared precision of 10.
> If Drill isn't going to allow a 10-digit value, it shouldn't accept a
> precision of 10 digits.
> Either the maximum allowed leading digit precision should be reduced to 9
> (because 9-digit values seem to be accepted--although larger 9-digit values
> are processed wrong) or 10-digit values should be accepted.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)