title: How to externalize and load property file from external path in a spark job when submitting the job
body: <p>I am using java8 and spark 2.4.1 to write my spark-job, in which I am using TypeSafe to load the property file i.e. application.properties which is located in "resources" folder, whose contents are like below</p>
  
  <pre><code>dev.deploymentMaster=local[8]
  dev.spark.eventLog.enabled=true
  dev.spark.dynamicAllocation.enabled=false
  dev.spark.executor.memory=8g
  </code></pre>
  
  <p>In program I am loading the same as below passing "environment" variable as "dev" while submitting the spark job i.e. spark-submit</p>
  
  <pre><code> public static Config loadEnvProperties(String environment) {
        Config appConf = ConfigFactory.load();
        return  appConf.getConfig(environment);
    }
  </code></pre>
  
  <p>Above is working fine....but this "application.properties" file is inside the "resources" folder.</p>
  
  <p>How can I pass the "application.properties" file path while submitting from spark-submit job ? What changes I need to do in my code using TypeSafe? can you please provide some sample if possible in java?</p>
  
  <p>In sprint boot we have something called profiling like application-dev.properties , application-qa.properties and application-prod.properties etc.... to load those specific environment properties is there something like possible in spark while submitting the job? If so can you please provide some details or snippet how to do achieve it ?</p>