GitHub user zjffdu opened a pull request:
https://github.com/apache/spark/pull/14959
[SPARK-17387][PYSPARK] Creating SparkContext() from python without
spark-submit ignores user conf
## What changes were proposed in this pull request?
The cause that now 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
In this PR, I would defer the launching of JVM until SparkContext is
created so that we can pass SparkConf to JVM correctly.
## How was this patch tested?
Use the example code in the description of SPARK-17387,
```
$ SPARK_HOME=$PWD PYTHONPATH=python:python/lib/py4j-0.10.3-src.zip python
Python 2.7.12 (default, Jul 1 2016, 15:12:24)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from pyspark import SparkContext
>>> from pyspark import SparkConf
>>> conf = SparkConf().set("spark.driver.memory", "4g")
>>> sc = SparkContext(conf=conf)
```
And verify the spark.driver.memory is correctly picked up.
```
...op/ -Xmx4g org.apache.spark.deploy.SparkSubmit --conf
spark.driver.memory=4g pyspark-shell
```
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/zjffdu/spark SPARK-17387
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/14959.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #14959
----
commit f97776152c1e1d02bf5049eb182e37a7e4d5ed52
Author: Jeff Zhang <[email protected]>
Date: 2016-09-05T08:37:06Z
[SPARK-17387][PYSPARK] Creating SparkContext() from python without
spark-submit ignores user conf
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]