Ian Hellstrom created DRILL-4497:
------------------------------------

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