Github user gatorsmile commented on a diff in the pull request:
https://github.com/apache/spark/pull/18668#discussion_r131317729
--- Diff:
sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLCLIDriver.scala
---
@@ -134,6 +135,16 @@ private[hive] object SparkSQLCLIDriver extends Logging
{
// Hive 1.2 + not supported in CLI
throw new RuntimeException("Remote operations not supported")
}
+ // Respect the configurations set by --hiveconf from the command line
+ // (based on Hive's CliDriver).
+ val hiveConfFromCmd =
sessionState.getOverriddenConfigurations.entrySet().asScala
+ val newHiveConf = hiveConfFromCmd.map { kv =>
+ // If the same property is configured by spark.hadoop.xxx, we ignore
it and
+ // obey settings from spark properties
+ val k = kv.getKey
+ val v = sys.props.getOrElseUpdate(SPARK_HADOOP_PROP_PREFIX + k,
kv.getValue)
--- End diff --
Let me try to summarize the impacts of these changes. The [initial
call](https://github.com/yaooqinn/spark/blob/5043eb69b41d1d0263e8814da27a934491bc936c/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLCLIDriver.scala#L86)
of `newTemporaryConfiguration` is before we setting `sys.props`. The
subsequent call of `newTemporaryConfiguration` in `newClientForExecution` will
be used for Hive execution clients. Thus, the changes will affect Hive
execution clients.
Could you check all the codes in Spark are using `sys.prop`? Will this
change impact them?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]