Github user viirya commented on a diff in the pull request: https://github.com/apache/spark/pull/21505#discussion_r193687346 --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/DateTimeUtils.scala --- @@ -114,20 +114,19 @@ object DateTimeUtils { } private val threadLocalComputedCalendarsMap = - new ThreadLocal[mutable.Map[TimeZone, (Calendar, Long)]] { - override def initialValue(): mutable.Map[TimeZone, (Calendar, Long)] = { - mutable.Map[TimeZone, (Calendar, Long)]() + new ThreadLocal[mutable.Map[TimeZone, Calendar]] { + override def initialValue(): mutable.Map[TimeZone, Calendar] = { + mutable.Map[TimeZone, Calendar]() } } def getCalendar(timeZone: TimeZone): Calendar = { - val (c, timeInMillis) = threadLocalComputedCalendarsMap.get() + val c = threadLocalComputedCalendarsMap.get() .getOrElseUpdate(timeZone, { - val c = Calendar.getInstance(timeZone) - (c, c.getTimeInMillis) + Calendar.getInstance(timeZone) }) c.clear() - c.setTimeInMillis(timeInMillis) + c.setTimeInMillis(System.currentTimeMillis()) --- End diff -- hmm, I think `System.currentTimeMillis()` is UTC-based?
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org