drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Barclay (Drill) (JIRA)" <j...@apache.org>
Subject [jira] [Created] (DRILL-3760) Casting interval to string and back to interval fails
Date Thu, 10 Sep 2015 21:13:45 GMT
Daniel Barclay (Drill) created DRILL-3760:

             Summary: Casting interval to string and back to interval fails
                 Key: DRILL-3760
                 URL: https://issues.apache.org/jira/browse/DRILL-3760
             Project: Apache Drill
          Issue Type: Bug
          Components: Functions - Drill
            Reporter: Daniel Barclay (Drill)
            Assignee: Mehant Baid

Casting from an interval type to {{VARCHAR(...)}} and then casting back to the same interval
type yields data format errors, for example:

0: jdbc:drill:drillbit=localhost> VALUES CAST( CAST( INTERVAL '1' MONTH AS VARCHAR(99)
Error: SYSTEM ERROR: IllegalArgumentException: Invalid format: "0 years 1 month "

[Error Id: 339d28df-b687-47f0-b6ce-1f7732e41660 on dev-linux2:31010] (state=,code=0)
0: jdbc:drill:drillbit=localhost> 

The problem seems to be in casting from interval types to strings.  The SQL standard specifies
that the result string has the syntax of a SQL literal, but Drill currently uses some other

0: jdbc:drill:drillbit=localhost> VALUES CAST( INTERVAL '1' YEAR AS VARCHAR(99) );
|      EXPR$0       |
| 1 year 0 months   |
1 row selected (0.27 seconds)
0: jdbc:drill:drillbit=localhost> 

This message was sent by Atlassian JIRA

View raw message