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

Jinfeng Ni updated DRILL-1470:
------------------------------
    Attachment:     (was: 
0001-DRILL-1470-cast-into-varchar-should-recognize-the-le.patch)

> 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: Mehant Baid
>
> 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)

Reply via email to