Repository: spark Updated Branches: refs/heads/branch-2.0 69b3e9cee -> eb0c49799
[SPARK-15520][SQL] Also set sparkContext confs when using SparkSession builder in pyspark ## What changes were proposed in this pull request? Also sets confs in the underlying sc when using SparkSession.builder.getOrCreate(). This is a bug-fix from a post-merge comment in https://github.com/apache/spark/pull/13289 ## How was this patch tested? Python doc-tests. Author: Eric Liang <e...@databricks.com> Closes #13309 from ericl/spark-15520-1. (cherry picked from commit 594a1bf200fea8d6bcf25839a49186f66f922bc8) Signed-off-by: Andrew Or <and...@databricks.com> Project: http://git-wip-us.apache.org/repos/asf/spark/repo Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/eb0c4979 Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/eb0c4979 Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/eb0c4979 Branch: refs/heads/branch-2.0 Commit: eb0c49799880acf2c35b95984b17fcb0ad7b5eca Parents: 69b3e9c Author: Eric Liang <e...@databricks.com> Authored: Thu May 26 12:05:47 2016 -0700 Committer: Andrew Or <and...@databricks.com> Committed: Thu May 26 12:05:55 2016 -0700 ---------------------------------------------------------------------- python/pyspark/sql/session.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/spark/blob/eb0c4979/python/pyspark/sql/session.py ---------------------------------------------------------------------- diff --git a/python/pyspark/sql/session.py b/python/pyspark/sql/session.py index 52e7f3d..8f7dcb5 100644 --- a/python/pyspark/sql/session.py +++ b/python/pyspark/sql/session.py @@ -144,7 +144,7 @@ class SparkSession(object): default. >>> s1 = SparkSession.builder.config("k1", "v1").getOrCreate() - >>> s1.conf.get("k1") == "v1" + >>> s1.conf.get("k1") == s1.sparkContext.getConf().get("k1") == "v1" True In case an existing SparkSession is returned, the config options specified @@ -168,6 +168,8 @@ class SparkSession(object): session = SparkSession(sc) for key, value in self._options.items(): session.conf.set(key, value) + for key, value in self._options.items(): + session.sparkContext._conf.set(key, value) return session builder = Builder() --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org For additional commands, e-mail: commits-h...@spark.apache.org