You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Daniel Barclay (Drill) (JIRA)" <ji...@apache.org> on 2015/06/30 22:08:04 UTC
[jira] [Commented] (DRILL-3432) Change or document: CAST to
interval type doesn't reject non-standard strings
[ https://issues.apache.org/jira/browse/DRILL-3432?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14608982#comment-14608982 ]
Daniel Barclay (Drill) commented on DRILL-3432:
-----------------------------------------------
(Supersedes only corresponding part of DRILL-2864.)
> Change or document: CAST to interval type doesn't reject non-standard strings
> -----------------------------------------------------------------------------
>
> Key: DRILL-3432
> URL: https://issues.apache.org/jira/browse/DRILL-3432
> Project: Apache Drill
> Issue Type: Bug
> Reporter: Daniel Barclay (Drill)
>
> In ISO/IEC 9075-2:2011(E) section 6.13 <cast specification>, General Rule 19 case b says that, in a <cast specification> casting to an interval type, a character string value must be a valid interval <literal> (<interval literal>) or <unquoted interval string>, or else a "data exception — invalid interval format" exception is raised.
> (<interval literal> is the "{{INTERVAL '1-6' YEAR TO MONTH}}" syntax; <unquoted interval string> is the "{{1-6}}" syntax.)
> However, in Drill, a cast specification casting to an interval type accepts strings not allowed by the SQL standard (ISO-8601 durations, e.g., "{{P1Y6M"}}).
>
> Drill should either follow the SQL standard or document the non-standard behavior in the end-user documentation.
>
> (Note that Drill's current behavior is not quite an extension: Although it does extend the set of strings that can be converted, it lacks the rejection of non-standard strings (for, say, validating strings destined for input into a standard-SQL system).)
> To continue providing the ability to convert ISO-8601-format duration strings into interval values without being non-compliant with the SQL standard, Drill could provide the conversions in conversion functions (perhaps CONVERT_FROM and/or CONVERT_TO).
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)