Please, I need your help, I'm trying to submit an external configuration file for my spark application using typesafe config.
I'm loading the application.conf file in my application code like this:
lazy val conf = ConfigFactory.load()
File content
ingestion{
process {
value = "sas"
}
sas {
origin{
value = "/route"
}
destination{
value = "/route"
}
extension{
value = ".sas7bdat"
}
file{
value = "mytable"
}
month{
value = "201010,201011"
}
table{
value = "tbl"
}
}
}
My spark submit is
spark2-submit --class com.antonio.Main --master yarn --deploy-mode client --driver-memory 10G --driver-cores 8 --executor-memory 13G --executor-cores 4 --num-executors 10 --verbose --files properties.conf /home/user/ingestion-1.0-SNAPSHOT-jar-with-dependencies.jar --files application.conf
But for some reason, I'm receiving
com.typesafe.config.ConfigException$Missing: No configuration setting found for key 'ingestion'
Everything looks configured correctly ?? Have I missed something.
thanks,
Antonio
Your
application.confby default must be present at the root of classpath forConfigFactory.load()to find it. Alternatively, you can modify where to find theapplication.conffile through system properties. Therefore, your options are as follows.First alternative is, add the root directory of the job to classpath:
Keep the
--filesoption as is. Note that if you run your job in the client mode, you must pass the proper path to whereapplication.confis located on the driver machine to thespark.driver.extraClassPathoption.Second alternative is (and I think this one is superior), you can use the
config.filesystem property to affect whereConfigFactory.load()looks for the config file:Remarks about loading config on executors and keeping the
--filesoption also apply here.