File tree Expand file tree Collapse file tree 2 files changed +8
-11
lines changed
sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver Expand file tree Collapse file tree 2 files changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -156,8 +156,13 @@ private[hive] object SparkSQLCLIDriver extends Logging {
156156 // Execute -i init files (always in silent mode)
157157 cli.processInitFiles(sessionState)
158158
159- // Respect the configurations from the command line and .hiverc for backward-compatible
160- SparkSQLEnv .applyOverridedConf(sessionState)
159+ // Respect the configurations set by --hiveconf from the command line
160+ // (based on Hive's CliDriver).
161+ val it = sessionState.getOverriddenConfigurations.entrySet().iterator()
162+ while (it.hasNext) {
163+ val kv = it.next()
164+ SparkSQLEnv .sqlContext.setConf(kv.getKey, kv.getValue)
165+ }
161166
162167 if (sessionState.execString != null ) {
163168 System .exit(cli.processLine(sessionState.execString))
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ package org.apache.spark.sql.hive.thriftserver
1919
2020import java .io .PrintStream
2121
22- import org . apache . hadoop . hive . ql . session . SessionState
22+ import scala . collection . JavaConverters . _
2323
2424import org .apache .spark .{SparkConf , SparkContext }
2525import org .apache .spark .internal .Logging
@@ -66,14 +66,6 @@ private[hive] object SparkSQLEnv extends Logging {
6666 }
6767 }
6868
69- def applyOverridedConf (ss : SessionState ): Unit = {
70- val it = ss.getOverriddenConfigurations.entrySet().iterator()
71- while (it.hasNext) {
72- val kv = it.next()
73- SparkSQLEnv .sqlContext.setConf(kv.getKey, kv.getValue)
74- }
75- }
76-
7769 /** Cleans up and shuts down the Spark SQL environments. */
7870 def stop () {
7971 logDebug(" Shutting down Spark SQL Environment" )
You can’t perform that action at this time.
0 commit comments