Skip to content

Commit

Permalink
For comment.
Browse files Browse the repository at this point in the history
  • Loading branch information
viirya committed Jun 5, 2015
1 parent c3e472a commit e19c6a3
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

package org.apache.spark.sql.catalyst.expressions

import java.math.{BigDecimal => JavaBigDecimal}
import java.sql.{Date, Timestamp}
import java.text.{DateFormat, SimpleDateFormat}

Expand Down Expand Up @@ -323,7 +324,7 @@ 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[UTF8String](_, s => try {
changePrecision(Decimal(new java.math.BigDecimal(s.toString)), target)
changePrecision(Decimal(new JavaBigDecimal(s.toString)), target)
} catch {
case _: NumberFormatException => null
})
Expand Down

0 comments on commit e19c6a3

Please sign in to comment.