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/10/02 00:10:26 UTC

[jira] [Created] (DRILL-3883) Trailing characters are ignored when casting from string to date

Victoria Markman created DRILL-3883:
---------------------------------------

             Summary: Trailing characters are ignored when casting from string to date
                 Key: DRILL-3883
                 URL: https://issues.apache.org/jira/browse/DRILL-3883
             Project: Apache Drill
          Issue Type: Bug
          Components: Query Planning & Optimization
    Affects Versions: 1.1.0, 1.2.0
            Reporter: Victoria Markman
            Priority: Minor


Explicit cast:
{code}
0: jdbc:drill:schema=dfs> select cast('2015-01-03 xxxxxxxxxxxxxxx' as date) from sys.options limit 1;
+-------------+
|   EXPR$0    |
+-------------+
| 2015-01-03  |
+-------------+
1 row selected (0.279 seconds)
{code}

Implicit cast:
{code}
0: jdbc:drill:schema=dfs> select * from t1;
+-------+--------+-------------+
|  a1   |   b1   |     c1      |
+-------+--------+-------------+
| 1     | aaaaa  | 2015-01-01  |
| 2     | bbbbb  | 2015-01-02  |
| 3     | ccccc  | 2015-01-03  |
| 4     | null   | 2015-01-04  |
| 5     | eeeee  | 2015-01-05  |
| 6     | fffff  | 2015-01-06  |
| 7     | ggggg  | 2015-01-07  |
| null  | hhhhh  | 2015-01-08  |
| 9     | iiiii  | null        |
| 10    | jjjjj  | 2015-01-10  |
+-------+--------+-------------+
10 rows selected (0.271 seconds)

0: jdbc:drill:schema=dfs> select * from t1 where c1 between cast('2015-01-01' as date) and '2015-01-03 xxxxxxxxxxxxxxx';
+-----+--------+-------------+
| a1  |   b1   |     c1      |
+-----+--------+-------------+
| 1   | aaaaa  | 2015-01-01  |
| 2   | bbbbb  | 2015-01-02  |
| 3   | ccccc  | 2015-01-03  |
+-----+--------+-------------+
3 rows selected (0.222 seconds)
{code}



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