GitHub user cloud-fan opened a pull request:

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

    [SPARK-23715][SQL] the input of to/from_utc_timestamp can not have timezone

    ## What changes were proposed in this pull request?
    
    `from_utc_timestamp` assumes its input is in UTC timezone and shifts it to 
the specified timezone. When the timestamp contains timezone(e.g. 
`2018-03-13T06:18:23+00:00`), Spark breaks the semantic and respect the 
timezone in the string. This is not what user expects and the result is 
different from Hive/Scala. `to_utc_timestamp` has the same problem.
    
    This PR fixes this by returning null if the input timestamp contains 
timezone.
    
    TODO: add a config
    
    ## How was this patch tested?
    
    new tests

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

    $ git pull https://github.com/cloud-fan/spark from_utc_timezone

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

    https://github.com/apache/spark/pull/21169.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 #21169
    
----
commit 7c1dcc3f3c144fe2aa1296c84840ff27a5a250e1
Author: Wenchen Fan <wenchen@...>
Date:   2018-04-26T16:01:38Z

    SPARK-23715: the input of to/from_utc_timestamp can not have timezone

----


---

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

Reply via email to