Skip to content

Commit b8080aa

Browse files
committed
[SPARK-5696] [SQL] [HOTFIX] Asks HiveThriftServer2 to re-initialize log4j using Hive configurations
In this way, log4j configurations overriden by jets3t-0.9.2.jar can be again overriden by Hive default log4j configurations. This might not be the best solution for this issue since it requires users to use `hive-log4j.properties` rather than `log4j.properties` to initialize `HiveThriftServer2` logging configurations, which can be confusing. The main purpose of this PR is to fix Jenkins PR build. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/apache/spark/4484) <!-- Reviewable:end --> Author: Cheng Lian <[email protected]> Closes #4484 from liancheng/spark-5696 and squashes the following commits: df83956 [Cheng Lian] Hot fix: asks HiveThriftServer2 to re-initialize log4j using Hive configurations
1 parent 5f0b30e commit b8080aa

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
package org.apache.spark.sql.hive.thriftserver
1919

2020
import org.apache.commons.logging.LogFactory
21+
import org.apache.hadoop.hive.common.LogUtils
2122
import org.apache.hadoop.hive.conf.HiveConf
2223
import org.apache.hadoop.hive.conf.HiveConf.ConfVars
2324
import org.apache.hive.service.cli.thrift.{ThriftBinaryCLIService, ThriftHttpCLIService}
@@ -54,6 +55,8 @@ object HiveThriftServer2 extends Logging {
5455
System.exit(-1)
5556
}
5657

58+
LogUtils.initHiveLog4j()
59+
5760
logInfo("Starting SparkContext")
5861
SparkSQLEnv.init()
5962

0 commit comments

Comments
 (0)