Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
cast(parm1 as varchar) 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)