diff options
author | Yin Huai <yhuai@databricks.com> | 2016-05-26 16:53:31 -0700 |
---|---|---|
committer | Yin Huai <yhuai@databricks.com> | 2016-05-26 16:53:31 -0700 |
commit | 3ac2363d757cc9cebc627974f17ecda3a263efdf (patch) | |
tree | 19f223d182ca9f1f077d1c383c91d0936c0c7385 /mllib/src | |
parent | e7082caeb4a53c1ee172d136894eece1ac880f65 (diff) | |
download | spark-3ac2363d757cc9cebc627974f17ecda3a263efdf.tar.gz spark-3ac2363d757cc9cebc627974f17ecda3a263efdf.tar.bz2 spark-3ac2363d757cc9cebc627974f17ecda3a263efdf.zip |
[SPARK-15532][SQL] SQLContext/HiveContext's public constructors should use SparkSession.build.getOrCreate
## What changes were proposed in this pull request?
This PR changes SQLContext/HiveContext's public constructor to use SparkSession.build.getOrCreate and removes isRootContext from SQLContext.
## How was this patch tested?
Existing tests.
Author: Yin Huai <yhuai@databricks.com>
Closes #13310 from yhuai/SPARK-15532.
Diffstat (limited to 'mllib/src')
-rw-r--r-- | mllib/src/main/scala/org/apache/spark/mllib/classification/LogisticRegression.scala | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mllib/src/main/scala/org/apache/spark/mllib/classification/LogisticRegression.scala b/mllib/src/main/scala/org/apache/spark/mllib/classification/LogisticRegression.scala index adbcdd302a..4bba2ea057 100644 --- a/mllib/src/main/scala/org/apache/spark/mllib/classification/LogisticRegression.scala +++ b/mllib/src/main/scala/org/apache/spark/mllib/classification/LogisticRegression.scala @@ -437,7 +437,7 @@ class LogisticRegressionWithLBFGS lr.setMaxIter(optimizer.getNumIterations()) lr.setTol(optimizer.getConvergenceTol()) // Convert our input into a DataFrame - val sqlContext = new SQLContext(input.context) + val sqlContext = SQLContext.getOrCreate(input.context) import sqlContext.implicits._ val df = input.map(_.asML).toDF() // Determine if we should cache the DF |