diff options
author | Andrew Or <andrew@databricks.com> | 2016-05-03 13:47:58 -0700 |
---|---|---|
committer | Reynold Xin <rxin@databricks.com> | 2016-05-03 13:47:58 -0700 |
commit | 588cac414a9cf1e0f40a82cc6a78f77e26825f29 (patch) | |
tree | aeaa2ed8067942678341aaa599d63b173f4cfa42 /repl | |
parent | 83ee92f60345f016a390d61a82f1d924f64ddf90 (diff) | |
download | spark-588cac414a9cf1e0f40a82cc6a78f77e26825f29.tar.gz spark-588cac414a9cf1e0f40a82cc6a78f77e26825f29.tar.bz2 spark-588cac414a9cf1e0f40a82cc6a78f77e26825f29.zip |
[SPARK-15073][SQL] Hide SparkSession constructor from the public
## What changes were proposed in this pull request?
Users should use the builder pattern instead.
## How was this patch tested?
Jenks.
Author: Andrew Or <andrew@databricks.com>
Closes #12873 from andrewor14/spark-session-constructor.
Diffstat (limited to 'repl')
-rw-r--r-- | repl/scala-2.10/src/main/scala/org/apache/spark/repl/SparkILoop.scala | 4 | ||||
-rw-r--r-- | repl/scala-2.11/src/main/scala/org/apache/spark/repl/Main.scala | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/repl/scala-2.10/src/main/scala/org/apache/spark/repl/SparkILoop.scala b/repl/scala-2.10/src/main/scala/org/apache/spark/repl/SparkILoop.scala index 6a811adcf9..c4f64505a2 100644 --- a/repl/scala-2.10/src/main/scala/org/apache/spark/repl/SparkILoop.scala +++ b/repl/scala-2.10/src/main/scala/org/apache/spark/repl/SparkILoop.scala @@ -1030,10 +1030,10 @@ class SparkILoop( def createSparkSession(): SparkSession = { if (SparkSession.hiveClassesArePresent) { logInfo("Creating Spark session with Hive support") - SparkSession.withHiveSupport(sparkContext) + SparkSession.builder.enableHiveSupport().getOrCreate() } else { logInfo("Creating Spark session") - new SparkSession(sparkContext) + SparkSession.builder.getOrCreate() } } diff --git a/repl/scala-2.11/src/main/scala/org/apache/spark/repl/Main.scala b/repl/scala-2.11/src/main/scala/org/apache/spark/repl/Main.scala index 8e381ff6ae..a171759809 100644 --- a/repl/scala-2.11/src/main/scala/org/apache/spark/repl/Main.scala +++ b/repl/scala-2.11/src/main/scala/org/apache/spark/repl/Main.scala @@ -94,10 +94,10 @@ object Main extends Logging { def createSparkSession(): SparkSession = { if (SparkSession.hiveClassesArePresent) { - sparkSession = SparkSession.withHiveSupport(sparkContext) + sparkSession = SparkSession.builder.enableHiveSupport().getOrCreate() logInfo("Created Spark session with Hive support") } else { - sparkSession = new SparkSession(sparkContext) + sparkSession = SparkSession.builder.getOrCreate() logInfo("Created Spark session") } sparkSession |