Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,21 @@ object HiveThriftServer2 extends Logging {
uiTab.foreach(_.detach())
}

val hadoopConf = SparkSQLEnv.sqlContext.sessionState.newHadoopConf()

val executionHive = HiveUtils.newClientForExecution(
SparkSQLEnv.sqlContext.sparkContext.conf,
SparkSQLEnv.sqlContext.sessionState.newHadoopConf())
hadoopConf
)

Seq(ConfVars.METASTOREURIS,
ConfVars.METASTORECONNECTURLKEY,
ConfVars.METASTORE_CONNECTION_USER_NAME,
ConfVars.METASTOREPWD,
ConfVars.METASTORE_CONNECTION_DRIVER,
ConfVars.METASTOREWAREHOUSE).foreach { key =>
executionHive.conf.set(key.varname, hadoopConf.get(key.varname))
}

try {
val server = new HiveThriftServer2(SparkSQLEnv.sqlContext)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ package org.apache.spark.sql.hive.thriftserver

import java.io.PrintStream

import org.apache.hadoop.hive.conf.HiveConf.ConfVars

import org.apache.spark.{SparkConf, SparkContext}
import org.apache.spark.internal.Logging
import org.apache.spark.sql.{SparkSession, SQLContext}
Expand Down Expand Up @@ -55,6 +57,15 @@ private[hive] object SparkSQLEnv extends Logging {
metadataHive.setInfo(new PrintStream(System.err, true, "UTF-8"))
metadataHive.setError(new PrintStream(System.err, true, "UTF-8"))
sparkSession.conf.set(HiveUtils.FAKE_HIVE_VERSION.key, HiveUtils.builtinHiveVersion)
Seq(ConfVars.METASTOREURIS,
ConfVars.METASTORE_CONNECTION_DRIVER,
ConfVars.METASTOREWAREHOUSE,
ConfVars.METASTOREPWD,
ConfVars.METASTORE_CONNECTION_USER_NAME,
ConfVars.METASTORECONNECTURLKEY).foreach { key =>
sparkContext.hadoopConfiguration
.set(key.varname, metadataHive.getConf(key.varname, key.defaultStrVal))
}
}
}

Expand Down