title: How can I get the current SparkSession in any place of the codes?
body: <p>I have created a session in the <code>main()</code> function, like this:</p>
  
  <pre><code>val sparkSession = SparkSession.builder.master("local[*]").appName("Simple Application").getOrCreate()
  </code></pre>
  
  <p>Now if I want to configure the application or access the properties, I can use the local variable <code>sparkSession</code> in the same function.</p>
  
  <p>What if I want to access this <code>sparkSession</code> elsewhere in the same project, like <code>project/module/.../.../xxx.scala</code>. What should I do?</p>