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

Ian Hellstrom updated DRILL-4497:
---------------------------------
    Affects Version/s: 1.5.0

> Casting strings with leading/trailing spaces to integers does not work
> ----------------------------------------------------------------------
>
>                 Key: DRILL-4497
>                 URL: https://issues.apache.org/jira/browse/DRILL-4497
>             Project: Apache Drill
>          Issue Type: Bug
>    Affects Versions: 1.5.0
>            Reporter: Ian Hellstrom
>
> When casting a string with leading and/or trailing spaces to an integer type 
> (e.g. INT or BIGINT), an exception is thrown. Casting the same numbers to 
> floating-point numbers works.
> This is inconsistent and extremely confusing. Simply using TRIM() before 
> casting works though.
> {code}
> SELECT CAST(' 1' AS INT) FROM ... 
> SELECT CAST('1 ' AS INT) FROM ...
> {code}



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

Reply via email to