You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Victoria Markman (JIRA)" <ji...@apache.org> on 2015/04/23 22:54:38 UTC

[jira] [Created] (DRILL-2864) Unable to cast string literal with the valid value in ISO 8601 format to interval

Victoria Markman created DRILL-2864:
---------------------------------------

             Summary: Unable to cast string literal with the valid value in ISO 8601 format to interval
                 Key: DRILL-2864
                 URL: https://issues.apache.org/jira/browse/DRILL-2864
             Project: Apache Drill
          Issue Type: Bug
          Components: Execution - Data Types
    Affects Versions: 0.9.0
            Reporter: Victoria Markman
            Assignee: Daniel Barclay (Drill)


{code}
0: jdbc:drill:schema=dfs> select cast('P1D' as interval day) from t1;
Query failed: PARSE ERROR: From line 1, column 8 to line 1, column 34: Cast function cannot convert value of type CHAR(3) to type INTERVAL DAY

[744f1f35-f8c5-46ba-80f9-0efd87036903 on atsqa4-134.qa.lab:31010]
Error: exception while executing query: Failure while executing query. (state=,code=0)
{code}

Workaround: cast to varchar.
{code}
0: jdbc:drill:schema=dfs> select cast(cast('P1D' as varchar(3)) as interval day) from t1;
+------------+
|   EXPR$0   |
+------------+
| P1D        |
| P1D        |
| P1D        |
| P1D        |
| P1D        |
| P1D        |
| P1D        |
| P1D        |
| P1D        |
| P1D        |
+------------+
10 rows selected (0.191 seconds)
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)