opened
ueshin
## What changes were proposed in this pull request?

Because the method `TimeZone.getTimeZone(String ID)` is synchronized on the TimeZone class, concurrent call of this method will become a bottleneck.
This especially happens when casting from string value containing timezone info to timestamp value, which uses `DateTimeUtils.stringToTimestamp()` and gets TimeZone instance on the site.

This pr makes a cache of the generated TimeZone instances per thread to avoid the synchronization.

## How was this patch tested?

Existing tests.
[SPARK-20588][SQL] Cache TimeZone instances per thread.
issue
created
viirya
LGTM
comment
created
gatorsmile
Thanks! Merging to master/2.2
comment
**[Test build #76923 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/76923/testReport)** for PR 17933 at commit [`3cdbb3a`](https://github.com/apache/spark/commit/3cdbb3acf12b2082056e8b4e2eb3f1645fa1bde7).
This message directly preceded comment from bot *SparkQA* by author *viirya*:
LGTM
This message directly preceded comment from bot *SparkQA* by author *viirya*:
LGTM