Unable to set Environment Variables in Spark Application

Viewed 5203

I am trying to set environment variable for my spark application, running in local mode.

Here is the spark-submit job:-

spark-submit --conf spark.executorEnv.FOO=bar --class com.amazon.Main SWALiveOrderModelSpark-1.0-super.jar

However, when I am trying to access this:-

System.out.println("env variable:- " + System.getenv("FOO"));

the output is:-

env variable:- null

Does anyone know how I can resolve this?

2 Answers
Related