You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Jinfeng Ni (JIRA)" <ji...@apache.org> on 2014/11/06 03:52:34 UTC

[jira] [Assigned] (DRILL-1470) Drill incorrectly ignore length parameter when cast into varchar/varbinary

     [ https://issues.apache.org/jira/browse/DRILL-1470?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jinfeng Ni reassigned DRILL-1470:
---------------------------------

    Assignee: Jinfeng Ni  (was: Mehant Baid)

> Drill incorrectly ignore length parameter when cast into varchar/varbinary 
> ---------------------------------------------------------------------------
>
>                 Key: DRILL-1470
>                 URL: https://issues.apache.org/jira/browse/DRILL-1470
>             Project: Apache Drill
>          Issue Type: Bug
>            Reporter: Jinfeng Ni
>            Assignee: Jinfeng Ni
>         Attachments: 0003-DRILL-1470-cast-into-varchar-should-recognize-the-le.patch
>
>
> cast(parm1 as varchar(n)) should return a string with up to n characters. However, currently Drill will ignore the length parameter. For example, 
> select first_name, cast(first_name as varchar(2)) from cp.`employee.json` limit 2;
> +------------+------------+
> | first_name |   EXPR$1   |
> +------------+------------+
> | Sheri      | Sheri      |
> | Derrick    | Derrick    |
> +------------+------------+
> 2 rows selected (0.285 seconds)
> In comparison, here is the result run on postgres.
> select cast('abcdef' as varchar(2)) from t1 limit 1;
>  varchar
> ---------
>  ab
> (1 row)



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