diff options
author | Marcelo Vanzin <vanzin@cloudera.com> | 2017-01-25 12:08:08 -0800 |
---|---|---|
committer | Marcelo Vanzin <vanzin@cloudera.com> | 2017-01-25 12:08:08 -0800 |
commit | 92afaa93a0b67f561a790822ccdd2b814455edcc (patch) | |
tree | 16ce02d79b9c132cd7adc66e9b3f2e6d1181b070 /python/pyspark/context.py | |
parent | f6480b1467d0432fb2aa48c7a3a8a6e6679fd481 (diff) | |
download | spark-92afaa93a0b67f561a790822ccdd2b814455edcc.tar.gz spark-92afaa93a0b67f561a790822ccdd2b814455edcc.tar.bz2 spark-92afaa93a0b67f561a790822ccdd2b814455edcc.zip |
[SPARK-19307][PYSPARK] Make sure user conf is propagated to SparkContext.
The code was failing to propagate the user conf in the case where the
JVM was already initialized, which happens when a user submits a
python script via spark-submit.
Tested with new unit test and by running a python script in a real cluster.
Author: Marcelo Vanzin <vanzin@cloudera.com>
Closes #16682 from vanzin/SPARK-19307.
Diffstat (limited to 'python/pyspark/context.py')
-rw-r--r-- | python/pyspark/context.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/python/pyspark/context.py b/python/pyspark/context.py index 5c4e79cb04..ac4b2b035f 100644 --- a/python/pyspark/context.py +++ b/python/pyspark/context.py @@ -132,6 +132,9 @@ class SparkContext(object): self._conf = conf else: self._conf = SparkConf(_jvm=SparkContext._jvm) + if conf is not None: + for k, v in conf.getAll(): + self._conf.set(k, v) self._batchSize = batchSize # -1 represents an unlimited batch size self._unbatched_serializer = serializer |