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
dev.deploymentMaster=local[8]
dev.spark.eventLog.enabled=true
dev.spark.dynamicAllocation.enabled=false
dev.spark.executor.memory=8g
In program I am loading the same as below passing "environment" variable as "dev" while submitting the spark job i.e. spark-submit
public static Config loadEnvProperties(String environment) {
Config appConf = ConfigFactory.load();
return appConf.getConfig(environment);
}
Above is working fine....but this "application.properties" file is inside the "resources" folder.
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?
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 ?