GitHub user ssonker opened a pull request:

    https://github.com/apache/spark/pull/21505

    [SPARK-24457][SQL] Improving performance of stringToTimestamp by cach…

    …ing Calendar instances for input timezones instead of creating new 
everytime
    
    ## What changes were proposed in this pull request?
    
    As of now, stringToTimestamp function in DateTimeUtils creates a calendar 
instance on each call. This change maintains a thread-local timezone to 
calendar map, and creates just one calendar for each timezone. Whenever a 
calendar instance is queried given a timezone, it is looked-up inside the map, 
reinitialized and returned.
    
    ## How was this patch tested?
    
    Using existing test cases.
    
    Please review http://spark.apache.org/contributing.html before opening a 
pull request.


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/ssonker/spark master

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/21505.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #21505
    
----
commit 84d5a911408411f327b620bb958b996e55264781
Author: Sharad Sonker <ssonker@...>
Date:   2018-06-07T04:56:37Z

    [SPARK-24457][SQL] Improving performance of stringToTimestamp by caching 
Calendar instances for input timezones instead of creating new everytime

----


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to