title: SparkContext.addFile vs spark-submit --files
body: <p>I am using Spark 1.6.0. I want to pass some properties files like log4j.properties and some other customer properties file. I see that we can use --files but I also saw that there is a method addFile in SparkContext. I did prefer to use --files instead of programatically adding the files, assuming both the options are same ?</p>
  
  <p>I did not find much documentation about --files, so is --files &amp; SparkContext.addFile both options same ?</p>
  
  <p>References I found about <a href="http://spark.apache.org/docs/1.6.0/running-on-yarn.html#configuration" rel="noreferrer">--files</a> and for <a href="https://spark.apache.org/docs/1.6.0/api/java/org/apache/spark/SparkContext.html#addFile(java.lang.String)" rel="noreferrer">SparkContext.addFile</a>.</p>