GitHub user davies opened a pull request:

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

    [SPARK-16078] [SQL] from_utc_timestamp/to_utc_timestamp should not depends 
on local timezone

    ## What changes were proposed in this pull request?
    
    Currently, we use local timezone to parse or format a timestamp 
(TimestampType), then use Long as the microseconds since epoch UTC.
    
    In from_utc_timestamp() and to_utc_timestamp(), we did not consider the 
local timezone, they could return different results with different local 
timezone.
    
    This PR will do the conversion based on human time (in local timezone), it 
should return same result in whatever timezone. But because the mapping from 
absolute timestamp to human time is not exactly one-to-one mapping, it will 
still return wrong result in some timezone (also in the begging or ending of 
DST).
    
    This PR is kind of the best effort fix. In long term, we should make the 
TimestampType be timezone aware to fix this totally.
    
    ## How was this patch tested?
    
    Tested these function in all timezone.


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

    $ git pull https://github.com/davies/spark convert_tz

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

    https://github.com/apache/spark/pull/13784.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 #13784
    
----
commit 5c60bc6321bda90c85a26180c38be5744d68cc55
Author: Davies Liu <[email protected]>
Date:   2016-06-20T19:48:35Z

    fix fromUTCTime/toUTCTime

----


---
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