title: How to set Spark application exit status?
body: <p>I'm writing a spark application and run it using spark-submit shell script (using yarn-cluster/yarn-client)</p>
  
  <p>As I see now, exit code of spark-submit is decided according to the related yarn application - if SUCCEEDED status is 0, otherwise 1.</p>
  
  <p>I want to have the option to return another exit code - for a state that my application succeeded with some errors.</p>
  
  <p>Is it possible? to return different exit code from the application?</p>
  
  <p>I tried to use System.exit() but didn't succeed...</p>
  
  <p>Thanks.</p>