Jinfeng Ni created DRILL-1470:
---------------------------------

             Summary: 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


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