diff options
author | Reynold Xin <rxin@databricks.com> | 2016-05-19 21:53:26 -0700 |
---|---|---|
committer | Reynold Xin <rxin@databricks.com> | 2016-05-19 21:53:26 -0700 |
commit | f2ee0ed4b7ecb2855cc4928a9613a07d45446f4e (patch) | |
tree | 3c923b935bcf35219f158ed5a8ca34edfb7c9322 /mllib/src/test | |
parent | 17591d90e6873f30a042112f56a1686726ccbd60 (diff) | |
download | spark-f2ee0ed4b7ecb2855cc4928a9613a07d45446f4e.tar.gz spark-f2ee0ed4b7ecb2855cc4928a9613a07d45446f4e.tar.bz2 spark-f2ee0ed4b7ecb2855cc4928a9613a07d45446f4e.zip |
[SPARK-15075][SPARK-15345][SQL] Clean up SparkSession builder and propagate config options to existing sessions if specified
## What changes were proposed in this pull request?
Currently SparkSession.Builder use SQLContext.getOrCreate. It should probably the the other way around, i.e. all the core logic goes in SparkSession, and SQLContext just calls that. This patch does that.
This patch also makes sure config options specified in the builder are propagated to the existing (and of course the new) SparkSession.
## How was this patch tested?
Updated tests to reflect the change, and also introduced a new SparkSessionBuilderSuite that should cover all the branches.
Author: Reynold Xin <rxin@databricks.com>
Closes #13200 from rxin/SPARK-15075.
Diffstat (limited to 'mllib/src/test')
-rw-r--r-- | mllib/src/test/java/org/apache/spark/ml/util/JavaDefaultReadWriteSuite.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mllib/src/test/java/org/apache/spark/ml/util/JavaDefaultReadWriteSuite.java b/mllib/src/test/java/org/apache/spark/ml/util/JavaDefaultReadWriteSuite.java index da623d1d15..7bda219243 100644 --- a/mllib/src/test/java/org/apache/spark/ml/util/JavaDefaultReadWriteSuite.java +++ b/mllib/src/test/java/org/apache/spark/ml/util/JavaDefaultReadWriteSuite.java @@ -56,7 +56,7 @@ public class JavaDefaultReadWriteSuite extends SharedSparkSession { } catch (IOException e) { // expected } - instance.write().context(spark.wrapped()).overwrite().save(outputPath); + instance.write().context(spark.sqlContext()).overwrite().save(outputPath); MyParams newInstance = MyParams.load(outputPath); Assert.assertEquals("UID should match.", instance.uid(), newInstance.uid()); Assert.assertEquals("Params should be preserved.", |