{"action":"created","issue":{"url":"https://api.github.com/repos/apache/spark/issues/12018","repository_url":"https://api.github.com/repos/apache/spark","labels_url":"https://api.github.com/repos/apache/spark/issues/12018/labels{/name}","comments_url":"https://api.github.com/repos/apache/spark/issues/12018/comments","events_url":"https://api.github.com/repos/apache/spark/issues/12018/events","html_url":"https://github.com/apache/spark/pull/12018","id":144114560,"number":12018,"title":"[SPARK-14219][GraphX] Fix `pickRandomVertex` not to fall into infinite loops for graphs with one vertex","user":{"login":"dongjoon-hyun","id":9700541,"avatar_url":"https://avatars.githubusercontent.com/u/9700541?v=3","gravatar_id":"","url":"https://api.github.com/users/dongjoon-hyun","html_url":"https://github.com/dongjoon-hyun","followers_url":"https://api.github.com/users/dongjoon-hyun/followers","following_url":"https://api.github.com/users/dongjoon-hyun/following{/other_user}","gists_url":"https://api.github.com/users/dongjoon-hyun/gists{/gist_id}","starred_url":"https://api.github.com/users/dongjoon-hyun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dongjoon-hyun/subscriptions","organizations_url":"https://api.github.com/users/dongjoon-hyun/orgs","repos_url":"https://api.github.com/users/dongjoon-hyun/repos","events_url":"https://api.github.com/users/dongjoon-hyun/events{/privacy}","received_events_url":"https://api.github.com/users/dongjoon-hyun/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-03-28T23:57:28Z","updated_at":"2016-03-29T00:21:35Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/12018","html_url":"https://github.com/apache/spark/pull/12018","diff_url":"https://github.com/apache/spark/pull/12018.diff","patch_url":"https://github.com/apache/spark/pull/12018.patch"},"body":"## What changes were proposed in this pull request?\r\n\r\nCurrently, `GraphOps.pickRandomVertex()` falls into infinite loops for graphs having only one vertex. This issue fixes it by modifying the following termination-checking condition.\r\n```scala\r\n-      if (selectedVertices.count > 1) {\r\n+      if (selectedVertices.count > 0) {\r\n```\r\n\r\n## How was this patch tested?\r\n\r\nPass the Jenkins tests (including new test case)."},"comment":{"url":"https://api.github.com/repos/apache/spark/issues/comments/202639596","html_url":"https://github.com/apache/spark/pull/12018#issuecomment-202639596","issue_url":"https://api.github.com/repos/apache/spark/issues/12018","id":202639596,"user":{"login":"AmplabJenkins","id":4031291,"avatar_url":"https://avatars.githubusercontent.com/u/4031291?v=3","gravatar_id":"","url":"https://api.github.com/users/AmplabJenkins","html_url":"https://github.com/AmplabJenkins","followers_url":"https://api.github.com/users/AmplabJenkins/followers","following_url":"https://api.github.com/users/AmplabJenkins/following{/other_user}","gists_url":"https://api.github.com/users/AmplabJenkins/gists{/gist_id}","starred_url":"https://api.github.com/users/AmplabJenkins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AmplabJenkins/subscriptions","organizations_url":"https://api.github.com/users/AmplabJenkins/orgs","repos_url":"https://api.github.com/users/AmplabJenkins/repos","events_url":"https://api.github.com/users/AmplabJenkins/events{/privacy}","received_events_url":"https://api.github.com/users/AmplabJenkins/received_events","type":"User","site_admin":false},"created_at":"2016-03-29T00:21:34Z","updated_at":"2016-03-29T00:21:34Z","body":"Merged build finished. Test PASSed."}}