Is it possible to submit an application configuration file without compiling it into the jar as a resource?
I am using the marvelous Typesafe Config (https://github.com/lightbend/config) with my data loading Spark application to load data into DSE Graph. I have tried various approaches such as:
Just include the conf file
dse spark-submit --class com.myorg.dataloader.MySparkLoader --files ./application.conf ./dataloader-spark-1.0.0.jar
which gets:
Exception in thread "main" java.lang.IllegalArgumentException: Graph 'default_graphname' does not exist
indicating it used the resources/reference.conf file.
Include conf file and tell the driver
dse spark-submit --class com.myorg.dataloader.MySparkLoader --files ./application.conf --driver-java-options "-Dconfig.resource=application.conf" ./dataloader-spark-1.0.0.jar
which gets:
Exception in thread "main" java.lang.ExceptionInInitializerError .... Caused by: java.io.IOException: resource not found on classpath: application.conf at com.typesafe.config.impl.Parseable$ParseableResources.rawParseValue(Parseable.java:726)
indicating it didn't find the actual file
Try loading from DSEFS
dse spark-submit --class com.myorg.dataloader.MySparkLoader --files ./application.conf --driver-java-options "-Dconfig.url=dsefs://application.conf" ./dataloader-spark-1.0.0.jar
which gets:
Exception in thread "main" java.lang.ExceptionInInitializerError .... Caused by: java.net.MalformedURLException: unknown protocol: dsefs at java.net.URL.<init>(URL.java:607)
which just made me sad.
Has someone solved this already for DSE Analytics? If so, would you please share your syntax? I would prefer not to have to load the config into DSEFS, but I'm open to doing that if it gets me the ability to configure spark applications from the command line.
Final note: I do use command line arguments for configuration in other places, but that is impractical with this particular application. My most basic config runs ~200 lines.