Repository: spark Updated Branches: refs/heads/branch-2.0 bd7fd14c9 -> a432e80b8
[SPARK-15037][HOTFIX] Don't create 2 SparkSessions in constructor ## What changes were proposed in this pull request? After #12907 `TestSparkSession` creates a spark session in one of the constructors just to get the `SparkContext` from it. This ends up creating 2 `SparkSession`s from one call, which is definitely not what we want. ## How was this patch tested? Jenkins. Author: Andrew Or <[email protected]> Closes #13031 from andrewor14/sql-test. (cherry picked from commit 69641066ae1d35c33b082451cef636a7f2e646d9) Signed-off-by: Andrew Or <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/spark/repo Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/a432e80b Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/a432e80b Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/a432e80b Branch: refs/heads/branch-2.0 Commit: a432e80b81cf898dd1886860ec7d50aa1dc43e7d Parents: bd7fd14 Author: Andrew Or <[email protected]> Authored: Tue May 10 12:07:47 2016 -0700 Committer: Andrew Or <[email protected]> Committed: Tue May 10 12:08:00 2016 -0700 ---------------------------------------------------------------------- .../org/apache/spark/sql/test/TestSQLContext.scala | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/spark/blob/a432e80b/sql/core/src/test/scala/org/apache/spark/sql/test/TestSQLContext.scala ---------------------------------------------------------------------- diff --git a/sql/core/src/test/scala/org/apache/spark/sql/test/TestSQLContext.scala b/sql/core/src/test/scala/org/apache/spark/sql/test/TestSQLContext.scala index 785e345..2f247ca 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/test/TestSQLContext.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/test/TestSQLContext.scala @@ -31,17 +31,7 @@ private[sql] class TestSparkSession(sc: SparkContext) extends SparkSession(sc) { } def this() { - this { - val conf = new SparkConf() - conf.set("spark.sql.testkey", "true") - - val spark = SparkSession.builder - .master("local[2]") - .appName("test-sql-context") - .config(conf) - .getOrCreate() - spark.sparkContext - } + this(new SparkConf) } @transient --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
