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

Kent Yao updated SPARK-30000:
-----------------------------
    Description: 
https://bugs.openjdk.java.net/browse/JDK-8170259
https://bugs.openjdk.java.net/browse/JDK-8170563

When we cast string type to decimal type, we rely on java.math. BigDecimal. It 
can't accept leading and training spaces, as you can see in the above links. 
This behavior is not consistent with other numeric types now. we need to fix it 
and keep consistency.


  was:
For example:

{code:sql}
SELECT bool '   f           ';
select int2 '  21234 ';
{code}



> Trim the string when cast string type to decimals
> -------------------------------------------------
>
>                 Key: SPARK-30000
>                 URL: https://issues.apache.org/jira/browse/SPARK-30000
>             Project: Spark
>          Issue Type: Sub-task
>          Components: SQL
>    Affects Versions: 3.0.0
>            Reporter: Kent Yao
>            Assignee: Kent Yao
>            Priority: Major
>             Fix For: 3.0.0
>
>
> https://bugs.openjdk.java.net/browse/JDK-8170259
> https://bugs.openjdk.java.net/browse/JDK-8170563
> When we cast string type to decimal type, we rely on java.math. BigDecimal. 
> It can't accept leading and training spaces, as you can see in the above 
> links. This behavior is not consistent with other numeric types now. we need 
> to fix it and keep consistency.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to