GitHub user zjffdu reopened a pull request:

    [SPARK-17387][PYSPARK] Creating SparkContext() from python without 
spark-submit ignores user conf

    ## What changes were proposed in this pull request?
    The root cause that we would ignore SparkConf when launching JVM is that 
SparkConf require JVM to be created first.
    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/ 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 SPARK-17387

Alternatively you can review and apply these changes as the patch at:

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 <>
Date:   2016-09-05T08:37:06Z

    [SPARK-17387][PYSPARK] Creating SparkContext() from python without 
spark-submit ignores user conf

commit 8ade76d1c81dea2c57bc70191e1c5da8ebf6b64e
Author: Jeff Zhang <>
Date:   2016-09-05T11:17:38Z

    fix code style

commit f24f9167e4225ea6f8c6b0868c4831934a2f0f34
Author: Jeff Zhang <>
Date:   2016-09-05T12:30:40Z

    fix unit test

commit b07c5749235bd17bb434710170f55f3c752cf7dc
Author: Jeff Zhang <>
Date:   2016-09-20T06:12:04Z

    address comment


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 or file a JIRA ticket
with INFRA.

To unsubscribe, e-mail:
For additional commands, e-mail:

Reply via email to