HIVE-11549: Hide Hive configuration from spark driver launching process 
(reviewed by Chao)


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/fe1efe52
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/fe1efe52
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/fe1efe52

Branch: refs/heads/llap
Commit: fe1efe520b807f24085d87fea8fc1c5ee0c9e44c
Parents: 2ccd061
Author: Xuefu Zhang <xzh...@cloudera.com>
Authored: Fri Aug 14 15:30:52 2015 -0700
Committer: Xuefu Zhang <xzh...@cloudera.com>
Committed: Fri Aug 14 15:30:52 2015 -0700

----------------------------------------------------------------------
 .../main/java/org/apache/hive/spark/client/SparkClientImpl.java  | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/fe1efe52/spark-client/src/main/java/org/apache/hive/spark/client/SparkClientImpl.java
----------------------------------------------------------------------
diff --git 
a/spark-client/src/main/java/org/apache/hive/spark/client/SparkClientImpl.java 
b/spark-client/src/main/java/org/apache/hive/spark/client/SparkClientImpl.java
index e1e64a7..2546a46 100644
--- 
a/spark-client/src/main/java/org/apache/hive/spark/client/SparkClientImpl.java
+++ 
b/spark-client/src/main/java/org/apache/hive/spark/client/SparkClientImpl.java
@@ -423,6 +423,10 @@ class SparkClientImpl implements SparkClient {
       LOG.info("Running client driver with argv: {}", cmd);
       ProcessBuilder pb = new ProcessBuilder("sh", "-c", cmd);
 
+      // Prevent hive configurations from being visible in Spark.
+      pb.environment().remove("HIVE_HOME");
+      pb.environment().remove("HIVE_CONF_DIR");
+
       if (isTesting != null) {
         pb.environment().put("SPARK_TESTING", isTesting);
       }

Reply via email to