Github user viirya commented on a diff in the pull request: https://github.com/apache/spark/pull/21505#discussion_r193696451 --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/DateTimeUtils.scala --- @@ -111,6 +113,23 @@ object DateTimeUtils { computedTimeZones.computeIfAbsent(timeZoneId, computeTimeZone) } + private val threadLocalComputedCalendarsMap = + new ThreadLocal[mutable.Map[TimeZone, Calendar]] { --- End diff -- Do we need to keep Calendar for many timezone? Since `getCalendar` takes a time zone input, we can just keep one Calendar instance, and set it with given timezone in `getCalendar`. WDYT? Regarding performance, is there big difference?
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org