You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Wenchen Fan (Jira)" <ji...@apache.org> on 2019/11/25 05:23:00 UTC

[jira] [Resolved] (SPARK-30000) Trim the string when cast string type to decimals

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

Wenchen Fan resolved SPARK-30000.
---------------------------------
    Resolution: Fixed

Issue resolved by pull request 26640
[https://github.com/apache/spark/pull/26640]

> 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-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org