GitHub user carsonwang opened a pull request:

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

    [SPARK-13185][SQL] Reuse Calendar object in DateTimeUtils.StringToDate 
method to improve performance

    The java `Calendar` object is expensive to create. I have a sub query like 
this `SELECT a, b, c FROM table UV WHERE (datediff(UV.visitDate, 
'1997-01-01')>=0 AND datediff(UV.visitDate, '2015-01-01')<=0))`
    
    The table stores `visitDate` as String type and has 3 billion records. A 
`Calendar` object is created every time `DateTimeUtils.stringToDate` is called. 
By reusing the `Calendar` object, I saw about 20 seconds performance 
improvement for this stage.

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

    $ git pull https://github.com/carsonwang/spark SPARK-13185

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

    https://github.com/apache/spark/pull/11090.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 #11090
    
----
commit 5bbbf917b326062c30a017a76203e97cdb0d0e74
Author: Carson Wang <[email protected]>
Date:   2016-02-05T07:02:24Z

    Reuse Calendar object in StringToDate method

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to