title: Spark-submit master url and SparkSession master url in the main class, what is difference?
body: <p>When submitting a job with spark-submit I set the master URL and give him a main class, ex:</p>
  
  <p><code>spark-submit --class WordCount --master spark://spark:7077 my.jar</code></p>
  
  <p>But inside this main class my spark context define another master url : </p>
  
  <pre><code>SparkSession.builder().appName("Word2vec").master("local").
  </code></pre>
  
  <p>This get me confused, what happens if I send a job with <code>spark-submit</code> to the master of a standalone cluster (<code>spark://spark:7077</code>) that start a <code>SparkSession</code> with a <code>local</code> master ? </p>
  
  <p>Should the <code>SparkSession</code> master url always be the same as the <code>spark-submit</code> url when executed on a cluster ?</p>