Github user yaooqinn commented on a diff in the pull request:
https://github.com/apache/spark/pull/18668#discussion_r131321807
--- 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 --
`newClientForExecution` is used ONLY in HiveThriftServer2, where it is used
to get a hiveconf. There is no more a execution hive client, IMO this method be
removed. This activity happens after `SparkSQLEnv.init`, so it is OK for
`spark.hadoop.` properties.
I realize that `--hiveconf` should be added to `sys.props` as
`spark.hadoop.xxx` before `SparkSQLEnv.init`
---
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]