spark-instrumented-optimizer/resource-managers
jerryshao c952000487 [SPARK-23635][YARN] AM env variable should not overwrite same name env variable set through spark.executorEnv.
## What changes were proposed in this pull request?

In the current Spark on YARN code, AM always will copy and overwrite its env variables to executors, so we cannot set different values for executors.

To reproduce issue, user could start spark-shell like:

```
./bin/spark-shell --master yarn-client --conf spark.executorEnv.SPARK_ABC=executor_val --conf  spark.yarn.appMasterEnv.SPARK_ABC=am_val
```

Then check executor env variables by

```
sc.parallelize(1 to 1).flatMap \{ i => sys.env.toSeq }.collect.foreach(println)
```

We will always get `am_val` instead of `executor_val`. So we should not let AM to overwrite specifically set executor env variables.

## How was this patch tested?

Added UT and tested in local cluster.

Author: jerryshao <sshao@hortonworks.com>

Closes #20799 from jerryshao/SPARK-23635.
2018-03-16 16:22:03 +08:00
..
kubernetes [SPARK-23449][K8S] Preserve extraJavaOptions ordering 2018-02-26 10:28:45 -08:00
mesos [SPARK-16501][MESOS] Allow providing Mesos principal & secret via files 2018-02-09 11:23:06 -08:00
yarn [SPARK-23635][YARN] AM env variable should not overwrite same name env variable set through spark.executorEnv. 2018-03-16 16:22:03 +08:00