{"action":"created","comment":{"url":"https://api.github.com/repos/apache/incubator-iceberg/pulls/comments/243401551","pull_request_review_id":187163498,"id":243401551,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0MzQwMTU1MQ==","diff_hunk":"@@ -138,18 +138,24 @@ project(':iceberg-data') {\n }\n \n project(':iceberg-hive') {\n-    dependencies {","path":"build.gradle","position":4,"original_position":4,"commit_id":"5d57c0d4715c7e9d726a9ba34d48375514ceccb6","original_commit_id":"5d57c0d4715c7e9d726a9ba34d48375514ceccb6","user":{"login":"Parth-Brahmbhatt","id":6914358,"node_id":"MDQ6VXNlcjY5MTQzNTg=","avatar_url":"https://avatars0.githubusercontent.com/u/6914358?v=4","gravatar_id":"","url":"https://api.github.com/users/Parth-Brahmbhatt","html_url":"https://github.com/Parth-Brahmbhatt","followers_url":"https://api.github.com/users/Parth-Brahmbhatt/followers","following_url":"https://api.github.com/users/Parth-Brahmbhatt/following{/other_user}","gists_url":"https://api.github.com/users/Parth-Brahmbhatt/gists{/gist_id}","starred_url":"https://api.github.com/users/Parth-Brahmbhatt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Parth-Brahmbhatt/subscriptions","organizations_url":"https://api.github.com/users/Parth-Brahmbhatt/orgs","repos_url":"https://api.github.com/users/Parth-Brahmbhatt/repos","events_url":"https://api.github.com/users/Parth-Brahmbhatt/events{/privacy}","received_events_url":"https://api.github.com/users/Parth-Brahmbhatt/received_events","type":"User","site_admin":false},"body":"No need to revert, hard to tell if it was intentional or not so just confirming.","created_at":"2018-12-20T20:05:03Z","updated_at":"2018-12-20T20:05:03Z","html_url":"https://github.com/apache/incubator-iceberg/pull/57#discussion_r243401551","pull_request_url":"https://api.github.com/repos/apache/incubator-iceberg/pulls/57","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/apache/incubator-iceberg/pulls/comments/243401551"},"html":{"href":"https://github.com/apache/incubator-iceberg/pull/57#discussion_r243401551"},"pull_request":{"href":"https://api.github.com/repos/apache/incubator-iceberg/pulls/57"}},"in_reply_to_id":243387235},"pull_request":{"url":"https://api.github.com/repos/apache/incubator-iceberg/pulls/57","id":239656409,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM5NjU2NDA5","html_url":"https://github.com/apache/incubator-iceberg/pull/57","diff_url":"https://github.com/apache/incubator-iceberg/pull/57.diff","patch_url":"https://github.com/apache/incubator-iceberg/pull/57.patch","issue_url":"https://api.github.com/repos/apache/incubator-iceberg/issues/57","number":57,"state":"open","locked":false,"title":"Use a UUID-based approach to generate snapshot ids","user":{"login":"aokolnychyi","id":6235869,"node_id":"MDQ6VXNlcjYyMzU4Njk=","avatar_url":"https://avatars3.githubusercontent.com/u/6235869?v=4","gravatar_id":"","url":"https://api.github.com/users/aokolnychyi","html_url":"https://github.com/aokolnychyi","followers_url":"https://api.github.com/users/aokolnychyi/followers","following_url":"https://api.github.com/users/aokolnychyi/following{/other_user}","gists_url":"https://api.github.com/users/aokolnychyi/gists{/gist_id}","starred_url":"https://api.github.com/users/aokolnychyi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aokolnychyi/subscriptions","organizations_url":"https://api.github.com/users/aokolnychyi/orgs","repos_url":"https://api.github.com/users/aokolnychyi/repos","events_url":"https://api.github.com/users/aokolnychyi/events{/privacy}","received_events_url":"https://api.github.com/users/aokolnychyi/received_events","type":"User","site_admin":false},"body":"This PR proposes a new approach for generating snapshot ids. \r\n\r\nRight now, Iceberg uses `System$currentTimeMillis()` as snapshot ids. If we have two concurrent writers, they might produce snapshots ids at the same time (up to milliseconds). As a consequence, we will have different snapshots with identical ids. Of course, only one writer will succeed. The failed one will retry but it will keep the old snapshot id (according to `SnapshotUpdate$snapshotId`). This will become a problem in `TableMetadata` when Iceberg builds `ImmutableMap<Long, Snapshot>`.\r\n\r\nOne way to eliminate collisions is to generate new snapshot ids on retries. However, this would mean Iceberg has to rewrite all created manifest files for the commit.\r\n\r\nThe proposed approach relies on UUID and XOR operations. To make snapshot ids positive, the result is wrapped into `Math$abs`. An alternative way to generate positive ids is `result & Long.MAX_VALUE`. Both options have identical performance (around 1 microsecond).\r\n\r\nWe can also consider [other approaches to generate unique long values](https://stackoverflow.com/a/5685869) or even switch to a different representation (e.g., UUID). The latter will have an impact on the metadata file sizes. Also, we do not have to make ids ordered as this is not required by logic and Iceberg already stores `timestamp-ms` for each snapshot.","created_at":"2018-12-18T22:42:50Z","updated_at":"2018-12-20T20:05:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0c62fc5ccfea8d71cb823e1bf4b6c4890ea84ab1","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/incubator-iceberg/pulls/57/commits","review_comments_url":"https://api.github.com/repos/apache/incubator-iceberg/pulls/57/comments","review_comment_url":"https://api.github.com/repos/apache/incubator-iceberg/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/incubator-iceberg/issues/57/comments","statuses_url":"https://api.github.com/repos/apache/incubator-iceberg/statuses/5d57c0d4715c7e9d726a9ba34d48375514ceccb6","head":{"label":"aokolnychyi:snapshot-id-fix","ref":"snapshot-id-fix","sha":"5d57c0d4715c7e9d726a9ba34d48375514ceccb6","user":{"login":"aokolnychyi","id":6235869,"node_id":"MDQ6VXNlcjYyMzU4Njk=","avatar_url":"https://avatars3.githubusercontent.com/u/6235869?v=4","gravatar_id":"","url":"https://api.github.com/users/aokolnychyi","html_url":"https://github.com/aokolnychyi","followers_url":"https://api.github.com/users/aokolnychyi/followers","following_url":"https://api.github.com/users/aokolnychyi/following{/other_user}","gists_url":"https://api.github.com/users/aokolnychyi/gists{/gist_id}","starred_url":"https://api.github.com/users/aokolnychyi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aokolnychyi/subscriptions","organizations_url":"https://api.github.com/users/aokolnychyi/orgs","repos_url":"https://api.github.com/users/aokolnychyi/repos","events_url":"https://api.github.com/users/aokolnychyi/events{/privacy}","received_events_url":"https://api.github.com/users/aokolnychyi/received_events","type":"User","site_admin":false},"repo":{"id":162352633,"node_id":"MDEwOlJlcG9zaXRvcnkxNjIzNTI2MzM=","name":"incubator-iceberg","full_name":"aokolnychyi/incubator-iceberg","private":false,"owner":{"login":"aokolnychyi","id":6235869,"node_id":"MDQ6VXNlcjYyMzU4Njk=","avatar_url":"https://avatars3.githubusercontent.com/u/6235869?v=4","gravatar_id":"","url":"https://api.github.com/users/aokolnychyi","html_url":"https://github.com/aokolnychyi","followers_url":"https://api.github.com/users/aokolnychyi/followers","following_url":"https://api.github.com/users/aokolnychyi/following{/other_user}","gists_url":"https://api.github.com/users/aokolnychyi/gists{/gist_id}","starred_url":"https://api.github.com/users/aokolnychyi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aokolnychyi/subscriptions","organizations_url":"https://api.github.com/users/aokolnychyi/orgs","repos_url":"https://api.github.com/users/aokolnychyi/repos","events_url":"https://api.github.com/users/aokolnychyi/events{/privacy}","received_events_url":"https://api.github.com/users/aokolnychyi/received_events","type":"User","site_admin":false},"html_url":"https://github.com/aokolnychyi/incubator-iceberg","description":"Apache Iceberg (Incubating)","fork":true,"url":"https://api.github.com/repos/aokolnychyi/incubator-iceberg","forks_url":"https://api.github.com/repos/aokolnychyi/incubator-iceberg/forks","keys_url":"https://api.github.com/repos/aokolnychyi/incubator-iceberg/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aokolnychyi/incubator-iceberg/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aokolnychyi/incubator-iceberg/teams","hooks_url":"https://api.github.com/repos/aokolnychyi/incubator-iceberg/hooks","issue_events_url":"https://api.github.com/repos/aokolnychyi/incubator-iceberg/issues/events{/number}","events_url":"https://api.github.com/repos/aokolnychyi/incubator-iceberg/events","assignees_url":"https://api.github.com/repos/aokolnychyi/incubator-iceberg/assignees{/user}","branches_url":"https://api.github.com/repos/aokolnychyi/incubator-iceberg/branches{/branch}","tags_url":"https://api.github.com/repos/aokolnychyi/incubator-iceberg/tags","blobs_url":"https://api.github.com/repos/aokolnychyi/incubator-iceberg/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aokolnychyi/incubator-iceberg/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aokolnychyi/incubator-iceberg/git/refs{/sha}","trees_url":"https://api.github.com/repos/aokolnychyi/incubator-iceberg/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aokolnychyi/incubator-iceberg/statuses/{sha}","languages_url":"https://api.github.com/repos/aokolnychyi/incubator-iceberg/languages","stargazers_url":"https://api.github.com/repos/aokolnychyi/incubator-iceberg/stargazers","contributors_url":"https://api.github.com/repos/aokolnychyi/incubator-iceberg/contributors","subscribers_url":"https://api.github.com/repos/aokolnychyi/incubator-iceberg/subscribers","subscription_url":"https://api.github.com/repos/aokolnychyi/incubator-iceberg/subscription","commits_url":"https://api.github.com/repos/aokolnychyi/incubator-iceberg/commits{/sha}","git_commits_url":"https://api.github.com/repos/aokolnychyi/incubator-iceberg/git/commits{/sha}","comments_url":"https://api.github.com/repos/aokolnychyi/incubator-iceberg/comments{/number}","issue_comment_url":"https://api.github.com/repos/aokolnychyi/incubator-iceberg/issues/comments{/number}","contents_url":"https://api.github.com/repos/aokolnychyi/incubator-iceberg/contents/{+path}","compare_url":"https://api.github.com/repos/aokolnychyi/incubator-iceberg/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aokolnychyi/incubator-iceberg/merges","archive_url":"https://api.github.com/repos/aokolnychyi/incubator-iceberg/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aokolnychyi/incubator-iceberg/downloads","issues_url":"https://api.github.com/repos/aokolnychyi/incubator-iceberg/issues{/number}","pulls_url":"https://api.github.com/repos/aokolnychyi/incubator-iceberg/pulls{/number}","milestones_url":"https://api.github.com/repos/aokolnychyi/incubator-iceberg/milestones{/number}","notifications_url":"https://api.github.com/repos/aokolnychyi/incubator-iceberg/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aokolnychyi/incubator-iceberg/labels{/name}","releases_url":"https://api.github.com/repos/aokolnychyi/incubator-iceberg/releases{/id}","deployments_url":"https://api.github.com/repos/aokolnychyi/incubator-iceberg/deployments","created_at":"2018-12-18T22:29:50Z","updated_at":"2018-12-18T22:29:54Z","pushed_at":"2018-12-18T22:30:46Z","git_url":"git://github.com/aokolnychyi/incubator-iceberg.git","ssh_url":"git@github.com:aokolnychyi/incubator-iceberg.git","clone_url":"https://github.com/aokolnychyi/incubator-iceberg.git","svn_url":"https://github.com/aokolnychyi/incubator-iceberg","homepage":"https://iceberg.apache.org/","size":2912,"stargazers_count":0,"watchers_count":0,"language":"Java","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":0,"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":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"ec31b27c5296ad73765939763ca46bb2d43ae140","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":158256479,"node_id":"MDEwOlJlcG9zaXRvcnkxNTgyNTY0Nzk=","name":"incubator-iceberg","full_name":"apache/incubator-iceberg","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/incubator-iceberg","description":"Apache Iceberg (Incubating)","fork":false,"url":"https://api.github.com/repos/apache/incubator-iceberg","forks_url":"https://api.github.com/repos/apache/incubator-iceberg/forks","keys_url":"https://api.github.com/repos/apache/incubator-iceberg/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/incubator-iceberg/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/incubator-iceberg/teams","hooks_url":"https://api.github.com/repos/apache/incubator-iceberg/hooks","issue_events_url":"https://api.github.com/repos/apache/incubator-iceberg/issues/events{/number}","events_url":"https://api.github.com/repos/apache/incubator-iceberg/events","assignees_url":"https://api.github.com/repos/apache/incubator-iceberg/assignees{/user}","branches_url":"https://api.github.com/repos/apache/incubator-iceberg/branches{/branch}","tags_url":"https://api.github.com/repos/apache/incubator-iceberg/tags","blobs_url":"https://api.github.com/repos/apache/incubator-iceberg/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/incubator-iceberg/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/incubator-iceberg/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/incubator-iceberg/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/incubator-iceberg/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/incubator-iceberg/languages","stargazers_url":"https://api.github.com/repos/apache/incubator-iceberg/stargazers","contributors_url":"https://api.github.com/repos/apache/incubator-iceberg/contributors","subscribers_url":"https://api.github.com/repos/apache/incubator-iceberg/subscribers","subscription_url":"https://api.github.com/repos/apache/incubator-iceberg/subscription","commits_url":"https://api.github.com/repos/apache/incubator-iceberg/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/incubator-iceberg/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/incubator-iceberg/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/incubator-iceberg/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/incubator-iceberg/contents/{+path}","compare_url":"https://api.github.com/repos/apache/incubator-iceberg/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/incubator-iceberg/merges","archive_url":"https://api.github.com/repos/apache/incubator-iceberg/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/incubator-iceberg/downloads","issues_url":"https://api.github.com/repos/apache/incubator-iceberg/issues{/number}","pulls_url":"https://api.github.com/repos/apache/incubator-iceberg/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/incubator-iceberg/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/incubator-iceberg/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/incubator-iceberg/labels{/name}","releases_url":"https://api.github.com/repos/apache/incubator-iceberg/releases{/id}","deployments_url":"https://api.github.com/repos/apache/incubator-iceberg/deployments","created_at":"2018-11-19T16:26:46Z","updated_at":"2018-12-19T19:38:32Z","pushed_at":"2018-12-20T01:15:38Z","git_url":"git://github.com/apache/incubator-iceberg.git","ssh_url":"git@github.com:apache/incubator-iceberg.git","clone_url":"https://github.com/apache/incubator-iceberg.git","svn_url":"https://github.com/apache/incubator-iceberg","homepage":"https://iceberg.apache.org/","size":2899,"stargazers_count":26,"watchers_count":26,"language":"Java","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":10,"mirror_url":null,"archived":false,"open_issues_count":34,"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":10,"open_issues":34,"watchers":26,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/incubator-iceberg/pulls/57"},"html":{"href":"https://github.com/apache/incubator-iceberg/pull/57"},"issue":{"href":"https://api.github.com/repos/apache/incubator-iceberg/issues/57"},"comments":{"href":"https://api.github.com/repos/apache/incubator-iceberg/issues/57/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/incubator-iceberg/pulls/57/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/incubator-iceberg/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/incubator-iceberg/pulls/57/commits"},"statuses":{"href":"https://api.github.com/repos/apache/incubator-iceberg/statuses/5d57c0d4715c7e9d726a9ba34d48375514ceccb6"}},"author_association":"NONE"}}
{"actor":{"display_login":"Parth-Brahmbhatt"}}