Skip to content

Commit c1a59dd

Browse files
baishuoliancheng
authored andcommitted
Update Cast.scala
1 parent 0e18496 commit c1a59dd

File tree

1 file changed

+7
-1
lines changed
  • sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions

1 file changed

+7
-1
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@
1818
package org.apache.spark.sql.catalyst.expressions
1919

2020
import java.sql.Timestamp
21-
import java.text.{DateFormat, SimpleDateFormat}
21+
import java.text.{DateFormat, NumberFormat, SimpleDateFormat}
2222

2323
import org.apache.spark.sql.catalyst.types._
24+
import java.util.Locale
2425

2526
/** Cast the child expression to the target data type. */
2627
case class Cast(child: Expression, dataType: DataType) extends UnaryExpression {
@@ -271,4 +272,9 @@ object Cast {
271272
new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")
272273
}
273274
}
275+
private[sql] val threadLocalNumberFormat = new ThreadLocal[NumberFormat] {
276+
override def initialValue() = {
277+
NumberFormat.getInstance()
278+
}
279+
}
274280
}

0 commit comments

Comments
 (0)