{"action":"created","comment":{"url":"https://api.github.com/repos/apache/spark/pulls/comments/264067573","pull_request_review_id":212631363,"id":264067573,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI2NDA2NzU3Mw==","diff_hunk":"@@ -33,15 +32,15 @@ class Iso8601DateFormatter(\n \n   @transient\n   private lazy val formatter = getOrCreateFormatter(pattern, locale)\n-  private val UTC = ZoneId.of(\"UTC\")\n+  private val UTC = ZoneOffset.UTC","path":"sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/DateFormatter.scala","position":18,"original_position":18,"commit_id":"63851a839da3bb0dc8f4a929364d9ce32466fc4c","original_commit_id":"63851a839da3bb0dc8f4a929364d9ce32466fc4c","user":{"login":"srowen","id":822522,"node_id":"MDQ6VXNlcjgyMjUyMg==","avatar_url":"https://avatars0.githubusercontent.com/u/822522?v=4","gravatar_id":"","url":"https://api.github.com/users/srowen","html_url":"https://github.com/srowen","followers_url":"https://api.github.com/users/srowen/followers","following_url":"https://api.github.com/users/srowen/following{/other_user}","gists_url":"https://api.github.com/users/srowen/gists{/gist_id}","starred_url":"https://api.github.com/users/srowen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/srowen/subscriptions","organizations_url":"https://api.github.com/users/srowen/orgs","repos_url":"https://api.github.com/users/srowen/repos","events_url":"https://api.github.com/users/srowen/events{/privacy}","received_events_url":"https://api.github.com/users/srowen/received_events","type":"User","site_admin":false},"body":"Not sure it matters, but this creates a field that always points to the same static instance. Can you just reference ZoneOffset.UTC directly rather than declare this?","created_at":"2019-03-11T00:25:36Z","updated_at":"2019-03-11T00:26:29Z","html_url":"https://github.com/apache/spark/pull/24030#discussion_r264067573","pull_request_url":"https://api.github.com/repos/apache/spark/pulls/24030","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/comments/264067573"},"html":{"href":"https://github.com/apache/spark/pull/24030#discussion_r264067573"},"pull_request":{"href":"https://api.github.com/repos/apache/spark/pulls/24030"}}},"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/24030","id":259619648,"node_id":"MDExOlB1bGxSZXF1ZXN0MjU5NjE5NjQ4","html_url":"https://github.com/apache/spark/pull/24030","diff_url":"https://github.com/apache/spark/pull/24030.diff","patch_url":"https://github.com/apache/spark/pull/24030.patch","issue_url":"https://api.github.com/repos/apache/spark/issues/24030","number":24030,"state":"open","locked":false,"title":"[SPARK-27109][SQL] Refactoring of TimestampFormatter and DateFormatter","user":{"login":"MaxGekk","id":1580697,"node_id":"MDQ6VXNlcjE1ODA2OTc=","avatar_url":"https://avatars1.githubusercontent.com/u/1580697?v=4","gravatar_id":"","url":"https://api.github.com/users/MaxGekk","html_url":"https://github.com/MaxGekk","followers_url":"https://api.github.com/users/MaxGekk/followers","following_url":"https://api.github.com/users/MaxGekk/following{/other_user}","gists_url":"https://api.github.com/users/MaxGekk/gists{/gist_id}","starred_url":"https://api.github.com/users/MaxGekk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MaxGekk/subscriptions","organizations_url":"https://api.github.com/users/MaxGekk/orgs","repos_url":"https://api.github.com/users/MaxGekk/repos","events_url":"https://api.github.com/users/MaxGekk/events{/privacy}","received_events_url":"https://api.github.com/users/MaxGekk/received_events","type":"User","site_admin":false},"body":"## What changes were proposed in this pull request?\r\n\r\nIn PR, I propose to refactor the `parse()` method of `Iso8601DateFormatter`/`Iso8601DateFormatter` and `toInstantWithZoneId` of `toInstantWithZoneId` to achieve the following:\r\n- Avoid unnecessary conversion of parsed input to `java.time.Instant` before converting it to micros and days. Necessary information exists in `ZonedDateTime` already, and micros/days can be extracted from the former one.\r\n- Avoid additional extraction of LocalTime from parsed object, more precisely, double query of `TemporalQueries.localTime` from `temporalAccessor`.\r\n- Avoid additional extraction of zone id from parsed object, in particular, double query of `TemporalQueries.offset()`.\r\n- Using `ZoneOffset.UTC` instead of `ZoneId.of` in `DateFormatter`. This allows to avoid looking for zone offset by zone id.\r\n\r\n## How was this patch tested?\r\n\r\nBy existing test suite `DateTimeUtilsSuite`, `TimestampFormatterSuite` and `DateFormatterSuite`.\r\n","created_at":"2019-03-08T21:56:22Z","updated_at":"2019-03-11T00:26:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"41b72e72944544d85d8074877df135858e5eed23","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/spark/pulls/24030/commits","review_comments_url":"https://api.github.com/repos/apache/spark/pulls/24030/comments","review_comment_url":"https://api.github.com/repos/apache/spark/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/spark/issues/24030/comments","statuses_url":"https://api.github.com/repos/apache/spark/statuses/63851a839da3bb0dc8f4a929364d9ce32466fc4c","head":{"label":"MaxGekk:query-localtime","ref":"query-localtime","sha":"63851a839da3bb0dc8f4a929364d9ce32466fc4c","user":{"login":"MaxGekk","id":1580697,"node_id":"MDQ6VXNlcjE1ODA2OTc=","avatar_url":"https://avatars1.githubusercontent.com/u/1580697?v=4","gravatar_id":"","url":"https://api.github.com/users/MaxGekk","html_url":"https://github.com/MaxGekk","followers_url":"https://api.github.com/users/MaxGekk/followers","following_url":"https://api.github.com/users/MaxGekk/following{/other_user}","gists_url":"https://api.github.com/users/MaxGekk/gists{/gist_id}","starred_url":"https://api.github.com/users/MaxGekk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MaxGekk/subscriptions","organizations_url":"https://api.github.com/users/MaxGekk/orgs","repos_url":"https://api.github.com/users/MaxGekk/repos","events_url":"https://api.github.com/users/MaxGekk/events{/privacy}","received_events_url":"https://api.github.com/users/MaxGekk/received_events","type":"User","site_admin":false},"repo":{"id":123690489,"node_id":"MDEwOlJlcG9zaXRvcnkxMjM2OTA0ODk=","name":"spark","full_name":"MaxGekk/spark","private":false,"owner":{"login":"MaxGekk","id":1580697,"node_id":"MDQ6VXNlcjE1ODA2OTc=","avatar_url":"https://avatars1.githubusercontent.com/u/1580697?v=4","gravatar_id":"","url":"https://api.github.com/users/MaxGekk","html_url":"https://github.com/MaxGekk","followers_url":"https://api.github.com/users/MaxGekk/followers","following_url":"https://api.github.com/users/MaxGekk/following{/other_user}","gists_url":"https://api.github.com/users/MaxGekk/gists{/gist_id}","starred_url":"https://api.github.com/users/MaxGekk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MaxGekk/subscriptions","organizations_url":"https://api.github.com/users/MaxGekk/orgs","repos_url":"https://api.github.com/users/MaxGekk/repos","events_url":"https://api.github.com/users/MaxGekk/events{/privacy}","received_events_url":"https://api.github.com/users/MaxGekk/received_events","type":"User","site_admin":false},"html_url":"https://github.com/MaxGekk/spark","description":"Mirror of Apache Spark","fork":true,"url":"https://api.github.com/repos/MaxGekk/spark","forks_url":"https://api.github.com/repos/MaxGekk/spark/forks","keys_url":"https://api.github.com/repos/MaxGekk/spark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MaxGekk/spark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MaxGekk/spark/teams","hooks_url":"https://api.github.com/repos/MaxGekk/spark/hooks","issue_events_url":"https://api.github.com/repos/MaxGekk/spark/issues/events{/number}","events_url":"https://api.github.com/repos/MaxGekk/spark/events","assignees_url":"https://api.github.com/repos/MaxGekk/spark/assignees{/user}","branches_url":"https://api.github.com/repos/MaxGekk/spark/branches{/branch}","tags_url":"https://api.github.com/repos/MaxGekk/spark/tags","blobs_url":"https://api.github.com/repos/MaxGekk/spark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MaxGekk/spark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MaxGekk/spark/git/refs{/sha}","trees_url":"https://api.github.com/repos/MaxGekk/spark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MaxGekk/spark/statuses/{sha}","languages_url":"https://api.github.com/repos/MaxGekk/spark/languages","stargazers_url":"https://api.github.com/repos/MaxGekk/spark/stargazers","contributors_url":"https://api.github.com/repos/MaxGekk/spark/contributors","subscribers_url":"https://api.github.com/repos/MaxGekk/spark/subscribers","subscription_url":"https://api.github.com/repos/MaxGekk/spark/subscription","commits_url":"https://api.github.com/repos/MaxGekk/spark/commits{/sha}","git_commits_url":"https://api.github.com/repos/MaxGekk/spark/git/commits{/sha}","comments_url":"https://api.github.com/repos/MaxGekk/spark/comments{/number}","issue_comment_url":"https://api.github.com/repos/MaxGekk/spark/issues/comments{/number}","contents_url":"https://api.github.com/repos/MaxGekk/spark/contents/{+path}","compare_url":"https://api.github.com/repos/MaxGekk/spark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MaxGekk/spark/merges","archive_url":"https://api.github.com/repos/MaxGekk/spark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MaxGekk/spark/downloads","issues_url":"https://api.github.com/repos/MaxGekk/spark/issues{/number}","pulls_url":"https://api.github.com/repos/MaxGekk/spark/pulls{/number}","milestones_url":"https://api.github.com/repos/MaxGekk/spark/milestones{/number}","notifications_url":"https://api.github.com/repos/MaxGekk/spark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MaxGekk/spark/labels{/name}","releases_url":"https://api.github.com/repos/MaxGekk/spark/releases{/id}","deployments_url":"https://api.github.com/repos/MaxGekk/spark/deployments","created_at":"2018-03-03T12:37:00Z","updated_at":"2019-03-08T18:09:24Z","pushed_at":"2019-03-10T15:55:04Z","git_url":"git://github.com/MaxGekk/spark.git","ssh_url":"git@github.com:MaxGekk/spark.git","clone_url":"https://github.com/MaxGekk/spark.git","svn_url":"https://github.com/MaxGekk/spark","homepage":null,"size":298867,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":5,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":5,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"14b13127276012163b3db6eebb5e6e8708efc50e","user":{"login":"apache","id":47359,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ3MzU5","avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":17165658,"node_id":"MDEwOlJlcG9zaXRvcnkxNzE2NTY1OA==","name":"spark","full_name":"apache/spark","private":false,"owner":{"login":"apache","id":47359,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ3MzU5","avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/apache/spark","description":"Apache Spark","fork":false,"url":"https://api.github.com/repos/apache/spark","forks_url":"https://api.github.com/repos/apache/spark/forks","keys_url":"https://api.github.com/repos/apache/spark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/spark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/spark/teams","hooks_url":"https://api.github.com/repos/apache/spark/hooks","issue_events_url":"https://api.github.com/repos/apache/spark/issues/events{/number}","events_url":"https://api.github.com/repos/apache/spark/events","assignees_url":"https://api.github.com/repos/apache/spark/assignees{/user}","branches_url":"https://api.github.com/repos/apache/spark/branches{/branch}","tags_url":"https://api.github.com/repos/apache/spark/tags","blobs_url":"https://api.github.com/repos/apache/spark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/spark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/spark/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/spark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/spark/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/spark/languages","stargazers_url":"https://api.github.com/repos/apache/spark/stargazers","contributors_url":"https://api.github.com/repos/apache/spark/contributors","subscribers_url":"https://api.github.com/repos/apache/spark/subscribers","subscription_url":"https://api.github.com/repos/apache/spark/subscription","commits_url":"https://api.github.com/repos/apache/spark/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/spark/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/spark/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/spark/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/spark/contents/{+path}","compare_url":"https://api.github.com/repos/apache/spark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/spark/merges","archive_url":"https://api.github.com/repos/apache/spark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/spark/downloads","issues_url":"https://api.github.com/repos/apache/spark/issues{/number}","pulls_url":"https://api.github.com/repos/apache/spark/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/spark/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/spark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/spark/labels{/name}","releases_url":"https://api.github.com/repos/apache/spark/releases{/id}","deployments_url":"https://api.github.com/repos/apache/spark/deployments","created_at":"2014-02-25T08:00:08Z","updated_at":"2019-03-10T23:33:27Z","pushed_at":"2019-03-11T00:10:38Z","git_url":"git://github.com/apache/spark.git","ssh_url":"git@github.com:apache/spark.git","clone_url":"https://github.com/apache/spark.git","svn_url":"https://github.com/apache/spark","homepage":"","size":296681,"stargazers_count":20867,"watchers_count":20867,"language":"Scala","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":18244,"mirror_url":null,"archived":false,"open_issues_count":463,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":18244,"open_issues":463,"watchers":20867,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/24030"},"html":{"href":"https://github.com/apache/spark/pull/24030"},"issue":{"href":"https://api.github.com/repos/apache/spark/issues/24030"},"comments":{"href":"https://api.github.com/repos/apache/spark/issues/24030/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/spark/pulls/24030/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/spark/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/spark/pulls/24030/commits"},"statuses":{"href":"https://api.github.com/repos/apache/spark/statuses/63851a839da3bb0dc8f4a929364d9ce32466fc4c"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"srowen"}}