{"action":"created","issue":{"url":"https://api.github.com/repos/apache/spark/issues/12809","repository_url":"https://api.github.com/repos/apache/spark","labels_url":"https://api.github.com/repos/apache/spark/issues/12809/labels{/name}","comments_url":"https://api.github.com/repos/apache/spark/issues/12809/comments","events_url":"https://api.github.com/repos/apache/spark/issues/12809/events","html_url":"https://github.com/apache/spark/pull/12809","id":152015269,"number":12809,"title":"[SPARK-15031][EXAMPLE] Use SparkSession in Scala/Python example.","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":13,"created_at":"2016-04-30T07:21:06Z","updated_at":"2016-04-30T11:05:50Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/12809","html_url":"https://github.com/apache/spark/pull/12809","diff_url":"https://github.com/apache/spark/pull/12809.diff","patch_url":"https://github.com/apache/spark/pull/12809.patch"},"body":"## What changes were proposed in this pull request?\r\n\r\nThis PR aims to update Scala/Python examples by replacing `SQLContext` with newly added `SparkSession`.\r\nAlso, this fixes the following examples.\r\n\r\n**sql.py**\r\n```\r\n-    people = sqlContext.jsonFile(path)\r\n+    people = sqlContext.read.json(path)\r\n...\r\n-    people.registerAsTable(\"people\")\r\n+    people.registerTempTable(\"people\")\r\n```\r\n\r\n**dataframe_example.py**\r\n```\r\n- features = df.select(\"features\").map(lambda r: r.features)\r\n+ features = df.select(\"features\").rdd.map(lambda r: r.features)\r\n```\r\n\r\n## How was this patch tested?\r\n\r\nManual."},"comment":{"url":"https://api.github.com/repos/apache/spark/issues/comments/215955422","html_url":"https://github.com/apache/spark/pull/12809#issuecomment-215955422","issue_url":"https://api.github.com/repos/apache/spark/issues/12809","id":215955422,"user":{"login":"SparkQA","id":8108735,"avatar_url":"https://avatars.githubusercontent.com/u/8108735?v=3","gravatar_id":"","url":"https://api.github.com/users/SparkQA","html_url":"https://github.com/SparkQA","followers_url":"https://api.github.com/users/SparkQA/followers","following_url":"https://api.github.com/users/SparkQA/following{/other_user}","gists_url":"https://api.github.com/users/SparkQA/gists{/gist_id}","starred_url":"https://api.github.com/users/SparkQA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SparkQA/subscriptions","organizations_url":"https://api.github.com/users/SparkQA/orgs","repos_url":"https://api.github.com/users/SparkQA/repos","events_url":"https://api.github.com/users/SparkQA/events{/privacy}","received_events_url":"https://api.github.com/users/SparkQA/received_events","type":"User","site_admin":false},"created_at":"2016-04-30T11:05:50Z","updated_at":"2016-04-30T11:05:50Z","body":"**[Test build #57440 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/57440/consoleFull)** for PR 12809 at commit [`5ebc6a7`](https://github.com/apache/spark/commit/5ebc6a74f18e8aab9c606eaffb3668e8af0341eb).\n * This patch passes all tests.\n * This patch merges cleanly.\n * This patch adds no public classes."}}