title: How do I run a local Spark 2.x Session?
body: <p>For testing purposes I want to have Spark 2.x run in a local mode. How can I do this? Can I do this? Currently I write in a <code>main</code>:</p>
  
  <pre><code>val spark = SparkSession
    .builder
    .appName("RandomForestClassifierExample")
    .getOrCreate()
  </code></pre>
  
  <p>and run the main in IntelliJ, but I get the error</p>
  
  <pre><code>org.apache.spark.SparkException: A master URL must be set in your configuration
  </code></pre>
  
  <p>I guess I need to have some local instance running or set a local mode or something like that. What should I do exactly?</p>