drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ian Hellstrom (JIRA)" <j...@apache.org>
Subject [jira] [Created] (DRILL-4497) Casting strings with leading/trailing spaces to integers does not work
Date Fri, 11 Mar 2016 13:11:53 GMT
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)

Mime
View raw message