title: How to pass -D parameter or environment variable to Spark job?
body: <p>I want to change <a href="https://github.com/typesafehub/config" rel="noreferrer">Typesafe config</a> of a Spark job in dev/prod environment. It seems to me that the easiest way to accomplish this is to pass <code>-Dconfig.resource=ENVNAME</code> to the job. Then Typesafe config library will do the job for me.</p>
  
  <p>Is there way to pass that option directly to the job? Or maybe there is better way to change job config at runtime?</p>
  
  <p><strong>EDIT:</strong></p>
  
  <ul>
  <li>Nothing happens when I add <code>--conf "spark.executor.extraJavaOptions=-Dconfig.resource=dev"</code> option to <em>spark-submit</em> command.</li>
  <li>I got <code>Error: Unrecognized option '-Dconfig.resource=dev'.</code> when I pass <code>-Dconfig.resource=dev</code> to <em>spark-submit</em> command.</li>
  </ul>