Github user davies commented on a diff in the pull request:

    https://github.com/apache/spark/pull/5350#discussion_r28018991
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala
 ---
    @@ -323,7 +323,9 @@ case class Cast(child: Expression, dataType: DataType) 
extends UnaryExpression w
     
       private[this] def castToDecimal(from: DataType, target: DecimalType): 
Any => Any = from match {
         case StringType =>
    -      buildCast[String](_, s => try changePrecision(Decimal(s.toDouble), 
target) catch {
    +      buildCast[UTF8String](_, s => try {
    +        changePrecision(Decimal(s.toString.toDouble), target)
    --- End diff --
    
    I guess Double is the wide format and range for numbers, or we need to have 
a special parser for it.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to