aboutsummaryrefslogtreecommitdiff
path: root/sql/hive-thriftserver/src/main
diff options
context:
space:
mode:
authorAndrew Or <andrew@databricks.com>2016-03-24 22:59:35 -0700
committerAndrew Or <andrew@databricks.com>2016-03-24 22:59:35 -0700
commit20ddf5fddf40b543edc61d6e4687988489dea64c (patch)
tree9bfac66a6e754af29b06ce5529a473795c005a8e /sql/hive-thriftserver/src/main
parent1c70b7650f21fc51a07db1e4f28cebbc1fb47e94 (diff)
downloadspark-20ddf5fddf40b543edc61d6e4687988489dea64c.tar.gz
spark-20ddf5fddf40b543edc61d6e4687988489dea64c.tar.bz2
spark-20ddf5fddf40b543edc61d6e4687988489dea64c.zip
[SPARK-14014][SQL] Integrate session catalog (attempt #2)
## What changes were proposed in this pull request? This reopens #11836, which was merged but promptly reverted because it introduced flaky Hive tests. ## How was this patch tested? See `CatalogTestCases`, `SessionCatalogSuite` and `HiveContextSuite`. Author: Andrew Or <andrew@databricks.com> Closes #11938 from andrewor14/session-catalog-again.
Diffstat (limited to 'sql/hive-thriftserver/src/main')
-rw-r--r--sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLCLIDriver.scala3
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLCLIDriver.scala b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLCLIDriver.scala
index 7fe31b0025..57693284b0 100644
--- a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLCLIDriver.scala
+++ b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLCLIDriver.scala
@@ -150,7 +150,8 @@ private[hive] object SparkSQLCLIDriver extends Logging {
}
if (sessionState.database != null) {
- SparkSQLEnv.hiveContext.runSqlHive(s"USE ${sessionState.database}")
+ SparkSQLEnv.hiveContext.sessionState.catalog.setCurrentDatabase(
+ s"${sessionState.database}")
}
// Execute -i init files (always in silent mode)