{"action":"created","comment":{"url":"https://api.github.com/repos/apache/spark/pulls/comments/62792294","id":62792294,"diff_hunk":"@@ -29,9 +29,18 @@ class SQLMetric(val metricType: String, initValue: Long = 0L) extends Accumulato\n   // We may use -1 as initial value of the accumulator, if the accumulator is valid, we will\n   // update it at the end of task and the value will be at least 0. Then we can filter out the -1\n   // values before calculate max, min, etc.\n-  private[this] var _value = initValue\n+  private var _value = initValue","path":"sql/core/src/main/scala/org/apache/spark/sql/execution/metric/SQLMetrics.scala","position":5,"original_position":5,"commit_id":"29fa76bd04938f4dad6115ca839fc63706be682b","original_commit_id":"29fa76bd04938f4dad6115ca839fc63706be682b","user":{"login":"techaddict","id":1378755,"avatar_url":"https://avatars.githubusercontent.com/u/1378755?v=3","gravatar_id":"","url":"https://api.github.com/users/techaddict","html_url":"https://github.com/techaddict","followers_url":"https://api.github.com/users/techaddict/followers","following_url":"https://api.github.com/users/techaddict/following{/other_user}","gists_url":"https://api.github.com/users/techaddict/gists{/gist_id}","starred_url":"https://api.github.com/users/techaddict/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/techaddict/subscriptions","organizations_url":"https://api.github.com/users/techaddict/orgs","repos_url":"https://api.github.com/users/techaddict/repos","events_url":"https://api.github.com/users/techaddict/events{/privacy}","received_events_url":"https://api.github.com/users/techaddict/received_events","type":"User","site_admin":false},"body":"That won't be correct. If we create a new accumulator with `initValue` as `_value` and do `reset` it will reset to `_value` instead of `initValue`. Can't think of a way around this.","created_at":"2016-05-11T05:05:00Z","updated_at":"2016-05-11T05:05:00Z","html_url":"https://github.com/apache/spark/pull/12936#discussion_r62792294","pull_request_url":"https://api.github.com/repos/apache/spark/pulls/12936","_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/comments/62792294"},"html":{"href":"https://github.com/apache/spark/pull/12936#discussion_r62792294"},"pull_request":{"href":"https://api.github.com/repos/apache/spark/pulls/12936"}}},"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/12936","id":69060001,"html_url":"https://github.com/apache/spark/pull/12936","diff_url":"https://github.com/apache/spark/pull/12936.diff","patch_url":"https://github.com/apache/spark/pull/12936.patch","issue_url":"https://api.github.com/repos/apache/spark/issues/12936","number":12936,"state":"open","locked":false,"title":"[SPARK-15080][CORE] Break copyAndReset into copy and reset","user":{"login":"techaddict","id":1378755,"avatar_url":"https://avatars.githubusercontent.com/u/1378755?v=3","gravatar_id":"","url":"https://api.github.com/users/techaddict","html_url":"https://github.com/techaddict","followers_url":"https://api.github.com/users/techaddict/followers","following_url":"https://api.github.com/users/techaddict/following{/other_user}","gists_url":"https://api.github.com/users/techaddict/gists{/gist_id}","starred_url":"https://api.github.com/users/techaddict/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/techaddict/subscriptions","organizations_url":"https://api.github.com/users/techaddict/orgs","repos_url":"https://api.github.com/users/techaddict/repos","events_url":"https://api.github.com/users/techaddict/events{/privacy}","received_events_url":"https://api.github.com/users/techaddict/received_events","type":"User","site_admin":false},"body":"## What changes were proposed in this pull request?\r\nBreak copyAndReset into two methods copy and reset instead of just one.\r\n\r\n## How was this patch tested?\r\nExisting Tests","created_at":"2016-05-05T19:51:09Z","updated_at":"2016-05-11T05:05:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"95c96bb0f919e43685d0cf98eadd2a1d5eda2c43","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/spark/pulls/12936/commits","review_comments_url":"https://api.github.com/repos/apache/spark/pulls/12936/comments","review_comment_url":"https://api.github.com/repos/apache/spark/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/spark/issues/12936/comments","statuses_url":"https://api.github.com/repos/apache/spark/statuses/29fa76bd04938f4dad6115ca839fc63706be682b","head":{"label":"techaddict:SPARK-15080","ref":"SPARK-15080","sha":"29fa76bd04938f4dad6115ca839fc63706be682b","user":{"login":"techaddict","id":1378755,"avatar_url":"https://avatars.githubusercontent.com/u/1378755?v=3","gravatar_id":"","url":"https://api.github.com/users/techaddict","html_url":"https://github.com/techaddict","followers_url":"https://api.github.com/users/techaddict/followers","following_url":"https://api.github.com/users/techaddict/following{/other_user}","gists_url":"https://api.github.com/users/techaddict/gists{/gist_id}","starred_url":"https://api.github.com/users/techaddict/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/techaddict/subscriptions","organizations_url":"https://api.github.com/users/techaddict/orgs","repos_url":"https://api.github.com/users/techaddict/repos","events_url":"https://api.github.com/users/techaddict/events{/privacy}","received_events_url":"https://api.github.com/users/techaddict/received_events","type":"User","site_admin":false},"repo":{"id":18507796,"name":"spark","full_name":"techaddict/spark","owner":{"login":"techaddict","id":1378755,"avatar_url":"https://avatars.githubusercontent.com/u/1378755?v=3","gravatar_id":"","url":"https://api.github.com/users/techaddict","html_url":"https://github.com/techaddict","followers_url":"https://api.github.com/users/techaddict/followers","following_url":"https://api.github.com/users/techaddict/following{/other_user}","gists_url":"https://api.github.com/users/techaddict/gists{/gist_id}","starred_url":"https://api.github.com/users/techaddict/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/techaddict/subscriptions","organizations_url":"https://api.github.com/users/techaddict/orgs","repos_url":"https://api.github.com/users/techaddict/repos","events_url":"https://api.github.com/users/techaddict/events{/privacy}","received_events_url":"https://api.github.com/users/techaddict/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/techaddict/spark","description":"Mirror of Apache Spark","fork":true,"url":"https://api.github.com/repos/techaddict/spark","forks_url":"https://api.github.com/repos/techaddict/spark/forks","keys_url":"https://api.github.com/repos/techaddict/spark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/techaddict/spark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/techaddict/spark/teams","hooks_url":"https://api.github.com/repos/techaddict/spark/hooks","issue_events_url":"https://api.github.com/repos/techaddict/spark/issues/events{/number}","events_url":"https://api.github.com/repos/techaddict/spark/events","assignees_url":"https://api.github.com/repos/techaddict/spark/assignees{/user}","branches_url":"https://api.github.com/repos/techaddict/spark/branches{/branch}","tags_url":"https://api.github.com/repos/techaddict/spark/tags","blobs_url":"https://api.github.com/repos/techaddict/spark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/techaddict/spark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/techaddict/spark/git/refs{/sha}","trees_url":"https://api.github.com/repos/techaddict/spark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/techaddict/spark/statuses/{sha}","languages_url":"https://api.github.com/repos/techaddict/spark/languages","stargazers_url":"https://api.github.com/repos/techaddict/spark/stargazers","contributors_url":"https://api.github.com/repos/techaddict/spark/contributors","subscribers_url":"https://api.github.com/repos/techaddict/spark/subscribers","subscription_url":"https://api.github.com/repos/techaddict/spark/subscription","commits_url":"https://api.github.com/repos/techaddict/spark/commits{/sha}","git_commits_url":"https://api.github.com/repos/techaddict/spark/git/commits{/sha}","comments_url":"https://api.github.com/repos/techaddict/spark/comments{/number}","issue_comment_url":"https://api.github.com/repos/techaddict/spark/issues/comments{/number}","contents_url":"https://api.github.com/repos/techaddict/spark/contents/{+path}","compare_url":"https://api.github.com/repos/techaddict/spark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/techaddict/spark/merges","archive_url":"https://api.github.com/repos/techaddict/spark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/techaddict/spark/downloads","issues_url":"https://api.github.com/repos/techaddict/spark/issues{/number}","pulls_url":"https://api.github.com/repos/techaddict/spark/pulls{/number}","milestones_url":"https://api.github.com/repos/techaddict/spark/milestones{/number}","notifications_url":"https://api.github.com/repos/techaddict/spark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/techaddict/spark/labels{/name}","releases_url":"https://api.github.com/repos/techaddict/spark/releases{/id}","deployments_url":"https://api.github.com/repos/techaddict/spark/deployments","created_at":"2014-04-07T06:05:50Z","updated_at":"2016-03-31T13:35:48Z","pushed_at":"2016-05-10T19:31:37Z","git_url":"git://github.com/techaddict/spark.git","ssh_url":"git@github.com:techaddict/spark.git","clone_url":"https://github.com/techaddict/spark.git","svn_url":"https://github.com/techaddict/spark","homepage":null,"size":165466,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"93353b0113158c87e09f0bad91a663a92e9cf1bc","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","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,"name":"spark","full_name":"apache/spark","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","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},"private":false,"html_url":"https://github.com/apache/spark","description":"Mirror of 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":"2016-05-11T02:46:21Z","pushed_at":"2016-05-11T04:54:49Z","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":null,"size":490969,"stargazers_count":8467,"watchers_count":8467,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":7857,"mirror_url":"git://git.apache.org/spark.git","open_issues_count":432,"forks":7857,"open_issues":432,"watchers":8467,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/12936"},"html":{"href":"https://github.com/apache/spark/pull/12936"},"issue":{"href":"https://api.github.com/repos/apache/spark/issues/12936"},"comments":{"href":"https://api.github.com/repos/apache/spark/issues/12936/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/spark/pulls/12936/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/spark/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/spark/pulls/12936/commits"},"statuses":{"href":"https://api.github.com/repos/apache/spark/statuses/29fa76bd04938f4dad6115ca839fc63706be682b"}}}}