Skip to content

Commit

Permalink
more configs
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Kruszewski committed Mar 15, 2017
1 parent 740d201 commit e4d0b1c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ import org.apache.spark.sql.execution._
import org.apache.spark.sql.execution.datasources.LogicalRelation
import org.apache.spark.sql.execution.ui.SQLListener
import org.apache.spark.sql.internal.{CatalogImpl, SessionState, SharedState}
import org.apache.spark.sql.internal.StaticSQLConf.CATALOG_IMPLEMENTATION
import org.apache.spark.sql.internal.StaticSQLConf.{CATALOG_IMPLEMENTATION, SESSION_STATE_IMPLEMENTATION}
import org.apache.spark.sql.sources.BaseRelation
import org.apache.spark.sql.streaming._
import org.apache.spark.sql.types.{DataType, LongType, StructType}
import org.apache.spark.sql.types.{DataType, StructType}
import org.apache.spark.sql.util.ExecutionListenerManager
import org.apache.spark.util.Utils

Expand Down Expand Up @@ -805,6 +805,7 @@ object SparkSession {
*/
def enableHiveSupport(): Builder = synchronized {
if (hiveClassesArePresent) {
config(SESSION_STATE_IMPLEMENTATION.key, "hive")
config(CATALOG_IMPLEMENTATION.key, "hive")
} else {
throw new IllegalArgumentException(
Expand Down Expand Up @@ -964,7 +965,7 @@ object SparkSession {
private val HIVE_SESSION_STATE_CLASS_NAME = "org.apache.spark.sql.hive.HiveSessionState"

private def sessionStateClassName(conf: SparkConf): String = {
conf.get(CATALOG_IMPLEMENTATION) match {
conf.get(SESSION_STATE_IMPLEMENTATION) match {
case "hive" => HIVE_SESSION_STATE_CLASS_NAME
case "in-memory" => classOf[SessionState].getCanonicalName
case name => name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1033,6 +1033,11 @@ object StaticSQLConf {
.stringConf
.createWithDefault("in-memory")

val SESSION_STATE_IMPLEMENTATION = buildStaticConf("spark.sql.sessionStateImplementation")
.internal()
.stringConf
.createWithDefault("in-memory")

val GLOBAL_TEMP_DATABASE = buildStaticConf("spark.sql.globalTempDatabase")
.internal()
.stringConf
Expand Down

0 comments on commit e4d0b1c

Please sign in to comment.