{"action":"created","issue":{"url":"https://api.github.com/repos/apache/spark/issues/21169","repository_url":"https://api.github.com/repos/apache/spark","labels_url":"https://api.github.com/repos/apache/spark/issues/21169/labels{/name}","comments_url":"https://api.github.com/repos/apache/spark/issues/21169/comments","events_url":"https://api.github.com/repos/apache/spark/issues/21169/events","html_url":"https://github.com/apache/spark/pull/21169","id":318099026,"number":21169,"title":"[SPARK-23715][SQL] the input of to/from_utc_timestamp can not have timezone","user":{"login":"cloud-fan","id":3182036,"avatar_url":"https://avatars3.githubusercontent.com/u/3182036?v=4","gravatar_id":"","url":"https://api.github.com/users/cloud-fan","html_url":"https://github.com/cloud-fan","followers_url":"https://api.github.com/users/cloud-fan/followers","following_url":"https://api.github.com/users/cloud-fan/following{/other_user}","gists_url":"https://api.github.com/users/cloud-fan/gists{/gist_id}","starred_url":"https://api.github.com/users/cloud-fan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloud-fan/subscriptions","organizations_url":"https://api.github.com/users/cloud-fan/orgs","repos_url":"https://api.github.com/users/cloud-fan/repos","events_url":"https://api.github.com/users/cloud-fan/events{/privacy}","received_events_url":"https://api.github.com/users/cloud-fan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-04-26T16:08:23Z","updated_at":"2018-04-28T13:13:40Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/21169","html_url":"https://github.com/apache/spark/pull/21169","diff_url":"https://github.com/apache/spark/pull/21169.diff","patch_url":"https://github.com/apache/spark/pull/21169.patch"},"body":"## What changes were proposed in this pull request?\r\n\r\n`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/Impala. `to_utc_timestamp` has the same problem.\r\n\r\nMore details please refer to the JIRA ticket.\r\n\r\nThis PR fixes this by returning null if the input timestamp contains timezone.\r\n\r\n## How was this patch tested?\r\n\r\nnew tests"},"comment":{"url":"https://api.github.com/repos/apache/spark/issues/comments/385175100","html_url":"https://github.com/apache/spark/pull/21169#issuecomment-385175100","issue_url":"https://api.github.com/repos/apache/spark/issues/21169","id":385175100,"user":{"login":"HyukjinKwon","id":6477701,"avatar_url":"https://avatars0.githubusercontent.com/u/6477701?v=4","gravatar_id":"","url":"https://api.github.com/users/HyukjinKwon","html_url":"https://github.com/HyukjinKwon","followers_url":"https://api.github.com/users/HyukjinKwon/followers","following_url":"https://api.github.com/users/HyukjinKwon/following{/other_user}","gists_url":"https://api.github.com/users/HyukjinKwon/gists{/gist_id}","starred_url":"https://api.github.com/users/HyukjinKwon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HyukjinKwon/subscriptions","organizations_url":"https://api.github.com/users/HyukjinKwon/orgs","repos_url":"https://api.github.com/users/HyukjinKwon/repos","events_url":"https://api.github.com/users/HyukjinKwon/events{/privacy}","received_events_url":"https://api.github.com/users/HyukjinKwon/received_events","type":"User","site_admin":false},"created_at":"2018-04-28T13:13:40Z","updated_at":"2018-04-28T13:13:40Z","author_association":"MEMBER","body":"I think we should fix the doc here too:\r\n\r\nhttps://github.com/apache/spark/blob/cd10f9df8284ee8a5d287b2cd204c70b8ba87f5e/sql/core/src/main/scala/org/apache/spark/sql/functions.scala#L2871-L2872"}}
{"actor":{"display_login":"HyukjinKwon"}}