aboutsummaryrefslogtreecommitdiff
path: root/sql/hive-thriftserver
diff options
context:
space:
mode:
authorReynold Xin <rxin@databricks.com>2016-05-19 21:53:26 -0700
committerReynold Xin <rxin@databricks.com>2016-05-19 21:53:26 -0700
commitf2ee0ed4b7ecb2855cc4928a9613a07d45446f4e (patch)
tree3c923b935bcf35219f158ed5a8ca34edfb7c9322 /sql/hive-thriftserver
parent17591d90e6873f30a042112f56a1686726ccbd60 (diff)
downloadspark-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 'sql/hive-thriftserver')
-rw-r--r--sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLEnv.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLEnv.scala b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLEnv.scala
index 8de223f444..638911599a 100644
--- a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLEnv.scala
+++ b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLEnv.scala
@@ -56,7 +56,7 @@ private[hive] object SparkSQLEnv extends Logging {
val sparkSession = SparkSession.builder.config(sparkConf).enableHiveSupport().getOrCreate()
sparkContext = sparkSession.sparkContext
- sqlContext = sparkSession.wrapped
+ sqlContext = sparkSession.sqlContext
val sessionState = sparkSession.sessionState.asInstanceOf[HiveSessionState]
sessionState.metadataHive.setOut(new PrintStream(System.out, true, "UTF-8"))