{"action":"created","comment":{"url":"https://api.github.com/repos/apache/spark/pulls/comments/82512981","pull_request_review_id":3417521,"id":82512981,"diff_hunk":"@@ -118,28 +130,28 @@ def setIfMissing(self, key, value):\n \n     def setMaster(self, value):\n         \"\"\"Set master URL to connect to.\"\"\"\n-        self._jconf.setMaster(value)\n+        self.set(\"spark.master\", value)\n         return self\n \n     def setAppName(self, value):\n         \"\"\"Set application name.\"\"\"\n-        self._jconf.setAppName(value)\n+        self.set(\"spark.app.name\", value)\n         return self\n \n     def setSparkHome(self, value):\n         \"\"\"Set path where Spark is installed on worker nodes.\"\"\"\n-        self._jconf.setSparkHome(value)\n+        self.set(\"spark.home\", value)\n         return self\n \n     def setExecutorEnv(self, key=None, value=None, pairs=None):\n         \"\"\"Set an environment variable to be passed to executors.\"\"\"\n         if (key is not None and pairs is not None) or (key is None and pairs is None):\n             raise Exception(\"Either pass one key-value pair or a list of pairs\")\n         elif key is not None:\n-            self._jconf.setExecutorEnv(key, value)\n+            self.set(\"spark.executorEnv.\" + key, value)","path":"python/pyspark/conf.py","position":67,"original_position":67,"commit_id":"ad47e3f6013eb0d5fa365417327de659fc3ce547","original_commit_id":"ad47e3f6013eb0d5fa365417327de659fc3ce547","user":{"login":"zjffdu","id":164491,"avatar_url":"https://avatars.githubusercontent.com/u/164491?v=3","gravatar_id":"","url":"https://api.github.com/users/zjffdu","html_url":"https://github.com/zjffdu","followers_url":"https://api.github.com/users/zjffdu/followers","following_url":"https://api.github.com/users/zjffdu/following{/other_user}","gists_url":"https://api.github.com/users/zjffdu/gists{/gist_id}","starred_url":"https://api.github.com/users/zjffdu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zjffdu/subscriptions","organizations_url":"https://api.github.com/users/zjffdu/orgs","repos_url":"https://api.github.com/users/zjffdu/repos","events_url":"https://api.github.com/users/zjffdu/events{/privacy}","received_events_url":"https://api.github.com/users/zjffdu/received_events","type":"User","site_admin":false},"body":"Fixed.","created_at":"2016-10-09T01:47:26Z","updated_at":"2016-10-09T01:47:26Z","html_url":"https://github.com/apache/spark/pull/14959#discussion_r82512981","pull_request_url":"https://api.github.com/repos/apache/spark/pulls/14959","_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/comments/82512981"},"html":{"href":"https://github.com/apache/spark/pull/14959#discussion_r82512981"},"pull_request":{"href":"https://api.github.com/repos/apache/spark/pulls/14959"}}},"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/14959","id":83974190,"html_url":"https://github.com/apache/spark/pull/14959","diff_url":"https://github.com/apache/spark/pull/14959.diff","patch_url":"https://github.com/apache/spark/pull/14959.patch","issue_url":"https://api.github.com/repos/apache/spark/issues/14959","number":14959,"state":"open","locked":false,"title":"[SPARK-17387][PYSPARK] Creating SparkContext() from python without spark-submit ignores user conf","user":{"login":"zjffdu","id":164491,"avatar_url":"https://avatars.githubusercontent.com/u/164491?v=3","gravatar_id":"","url":"https://api.github.com/users/zjffdu","html_url":"https://github.com/zjffdu","followers_url":"https://api.github.com/users/zjffdu/followers","following_url":"https://api.github.com/users/zjffdu/following{/other_user}","gists_url":"https://api.github.com/users/zjffdu/gists{/gist_id}","starred_url":"https://api.github.com/users/zjffdu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zjffdu/subscriptions","organizations_url":"https://api.github.com/users/zjffdu/orgs","repos_url":"https://api.github.com/users/zjffdu/repos","events_url":"https://api.github.com/users/zjffdu/events{/privacy}","received_events_url":"https://api.github.com/users/zjffdu/received_events","type":"User","site_admin":false},"body":"## What changes were proposed in this pull request?\r\n\r\nThe root cause that we would ignore SparkConf when launching JVM is that SparkConf require JVM to be created first.  https://github.com/apache/spark/blob/master/python/pyspark/conf.py#L106\r\nIn this PR, I would defer the launching of JVM until SparkContext is created so that we can pass SparkConf to JVM correctly. \r\n\r\n\r\n## How was this patch tested?\r\n\r\nUse the example code in the description of SPARK-17387,\r\n```\r\n$ SPARK_HOME=$PWD PYTHONPATH=python:python/lib/py4j-0.10.3-src.zip python\r\nPython 2.7.12 (default, Jul  1 2016, 15:12:24) \r\n[GCC 5.4.0 20160609] on linux2\r\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n>>> from pyspark import SparkContext\r\n>>> from pyspark import SparkConf\r\n>>> conf = SparkConf().set(\"spark.driver.memory\", \"4g\")\r\n>>> sc = SparkContext(conf=conf)\r\n```\r\nAnd verify the spark.driver.memory is correctly picked up.\r\n\r\n```\r\n...op/ -Xmx4g org.apache.spark.deploy.SparkSubmit --conf spark.driver.memory=4g pyspark-shell\r\n```\r\n","created_at":"2016-09-05T09:32:02Z","updated_at":"2016-10-09T01:47:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a0c3b403ea72f9d5d060f097840fb79fabfc8044","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/spark/pulls/14959/commits","review_comments_url":"https://api.github.com/repos/apache/spark/pulls/14959/comments","review_comment_url":"https://api.github.com/repos/apache/spark/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/spark/issues/14959/comments","statuses_url":"https://api.github.com/repos/apache/spark/statuses/ad47e3f6013eb0d5fa365417327de659fc3ce547","head":{"label":"zjffdu:SPARK-17387","ref":"SPARK-17387","sha":"ad47e3f6013eb0d5fa365417327de659fc3ce547","user":{"login":"zjffdu","id":164491,"avatar_url":"https://avatars.githubusercontent.com/u/164491?v=3","gravatar_id":"","url":"https://api.github.com/users/zjffdu","html_url":"https://github.com/zjffdu","followers_url":"https://api.github.com/users/zjffdu/followers","following_url":"https://api.github.com/users/zjffdu/following{/other_user}","gists_url":"https://api.github.com/users/zjffdu/gists{/gist_id}","starred_url":"https://api.github.com/users/zjffdu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zjffdu/subscriptions","organizations_url":"https://api.github.com/users/zjffdu/orgs","repos_url":"https://api.github.com/users/zjffdu/repos","events_url":"https://api.github.com/users/zjffdu/events{/privacy}","received_events_url":"https://api.github.com/users/zjffdu/received_events","type":"User","site_admin":false},"repo":{"id":39936462,"name":"spark","full_name":"zjffdu/spark","owner":{"login":"zjffdu","id":164491,"avatar_url":"https://avatars.githubusercontent.com/u/164491?v=3","gravatar_id":"","url":"https://api.github.com/users/zjffdu","html_url":"https://github.com/zjffdu","followers_url":"https://api.github.com/users/zjffdu/followers","following_url":"https://api.github.com/users/zjffdu/following{/other_user}","gists_url":"https://api.github.com/users/zjffdu/gists{/gist_id}","starred_url":"https://api.github.com/users/zjffdu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zjffdu/subscriptions","organizations_url":"https://api.github.com/users/zjffdu/orgs","repos_url":"https://api.github.com/users/zjffdu/repos","events_url":"https://api.github.com/users/zjffdu/events{/privacy}","received_events_url":"https://api.github.com/users/zjffdu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/zjffdu/spark","description":"Mirror of Apache Spark","fork":true,"url":"https://api.github.com/repos/zjffdu/spark","forks_url":"https://api.github.com/repos/zjffdu/spark/forks","keys_url":"https://api.github.com/repos/zjffdu/spark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zjffdu/spark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zjffdu/spark/teams","hooks_url":"https://api.github.com/repos/zjffdu/spark/hooks","issue_events_url":"https://api.github.com/repos/zjffdu/spark/issues/events{/number}","events_url":"https://api.github.com/repos/zjffdu/spark/events","assignees_url":"https://api.github.com/repos/zjffdu/spark/assignees{/user}","branches_url":"https://api.github.com/repos/zjffdu/spark/branches{/branch}","tags_url":"https://api.github.com/repos/zjffdu/spark/tags","blobs_url":"https://api.github.com/repos/zjffdu/spark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zjffdu/spark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zjffdu/spark/git/refs{/sha}","trees_url":"https://api.github.com/repos/zjffdu/spark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zjffdu/spark/statuses/{sha}","languages_url":"https://api.github.com/repos/zjffdu/spark/languages","stargazers_url":"https://api.github.com/repos/zjffdu/spark/stargazers","contributors_url":"https://api.github.com/repos/zjffdu/spark/contributors","subscribers_url":"https://api.github.com/repos/zjffdu/spark/subscribers","subscription_url":"https://api.github.com/repos/zjffdu/spark/subscription","commits_url":"https://api.github.com/repos/zjffdu/spark/commits{/sha}","git_commits_url":"https://api.github.com/repos/zjffdu/spark/git/commits{/sha}","comments_url":"https://api.github.com/repos/zjffdu/spark/comments{/number}","issue_comment_url":"https://api.github.com/repos/zjffdu/spark/issues/comments{/number}","contents_url":"https://api.github.com/repos/zjffdu/spark/contents/{+path}","compare_url":"https://api.github.com/repos/zjffdu/spark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zjffdu/spark/merges","archive_url":"https://api.github.com/repos/zjffdu/spark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zjffdu/spark/downloads","issues_url":"https://api.github.com/repos/zjffdu/spark/issues{/number}","pulls_url":"https://api.github.com/repos/zjffdu/spark/pulls{/number}","milestones_url":"https://api.github.com/repos/zjffdu/spark/milestones{/number}","notifications_url":"https://api.github.com/repos/zjffdu/spark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zjffdu/spark/labels{/name}","releases_url":"https://api.github.com/repos/zjffdu/spark/releases{/id}","deployments_url":"https://api.github.com/repos/zjffdu/spark/deployments","created_at":"2015-07-30T07:09:14Z","updated_at":"2016-01-20T21:53:02Z","pushed_at":"2016-09-26T06:31:36Z","git_url":"git://github.com/zjffdu/spark.git","ssh_url":"git@github.com:zjffdu/spark.git","clone_url":"https://github.com/zjffdu/spark.git","svn_url":"https://github.com/zjffdu/spark","homepage":null,"size":179546,"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":"4a426ff8aea4faa31a3016a453dec5b7954578dd","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-10-09T00:53:27Z","pushed_at":"2016-10-09T01:33:10Z","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":531516,"stargazers_count":10281,"watchers_count":10281,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":9555,"mirror_url":"git://git.apache.org/spark.git","open_issues_count":475,"forks":9555,"open_issues":475,"watchers":10281,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/14959"},"html":{"href":"https://github.com/apache/spark/pull/14959"},"issue":{"href":"https://api.github.com/repos/apache/spark/issues/14959"},"comments":{"href":"https://api.github.com/repos/apache/spark/issues/14959/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/spark/pulls/14959/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/spark/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/spark/pulls/14959/commits"},"statuses":{"href":"https://api.github.com/repos/apache/spark/statuses/ad47e3f6013eb0d5fa365417327de659fc3ce547"}}}}
{"actor":{"display_login":"zjffdu"}}