Skip to content
Snippets Groups Projects
Commit 69641066 authored by Andrew Or's avatar Andrew Or
Browse files

[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 <andrew@databricks.com>

Closes #13031 from andrewor14/sql-test.
parent db3b4a20
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment