Skip to content

Commit c3066e1

Browse files
authored
Making dateFormatter lazy in cast
1 parent ecf0e89 commit c3066e1

File tree

1 file changed

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

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ case class Cast(child: Expression, dataType: DataType, timeZoneId: Option[String
230230
// [[func]] assumes the input is no longer null because eval already does the null check.
231231
@inline private[this] def buildCast[T](a: Any, func: T => Any): Any = func(a.asInstanceOf[T])
232232

233-
private val dateFormatter = DateFormatter()
233+
private lazy val dateFormatter = DateFormatter()
234234
private lazy val timestampFormatter = TimestampFormatter(timeZone)
235235

236236
// UDFToString

0 commit comments

Comments
 (0)