Skip to content

Commit a5310d1

Browse files
committed
Make HiveThriftServer2 play well with spark-submit
1 parent 61f39f4 commit a5310d1

File tree

1 file changed

+2
-11
lines changed
  • sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver

1 file changed

+2
-11
lines changed

sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLEnv.scala

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,8 @@ object SparkSQLEnv extends Logging {
3434

3535
def init() {
3636
if (hiveContext == null) {
37-
val jobName: String = "SparkSQL::" + java.net.InetAddress.getLocalHost.getHostName
38-
val master: String = System.getenv("MASTER")
39-
40-
sparkContext = {
41-
val sparkConf = new SparkConf()
42-
.setMaster(Option(master).getOrElse("local"))
43-
.setAppName(jobName)
44-
45-
Option(System.getenv("SPARK_HOME")).foreach(sparkConf.setSparkHome)
46-
new SparkContext(sparkConf, Map[String, Set[SplitInfo]]())
47-
}
37+
sparkContext = new SparkContext(new SparkConf()
38+
.setAppName(s"SparkSQL::${java.net.InetAddress.getLocalHost.getHostName}"))
4839

4940
sparkContext.addSparkListener(new StatsReportListener())
5041

0 commit comments

Comments
 (0)