How to access SparkContext from SparkSession instance? : <p>I am importing <code>SparkSession</code> as follows in PySpark:</p>

<pre><code>from pyspark.sql import SparkSession
</code></pre>

<p>Then I create <code>SparkSession</code>:</p>

<pre><code>spark = SparkSession.builder.appName("test").getOrCreate()
</code></pre>

<p>and try to access <code>SparkContext</code>:</p>

<pre><code>spark.SparkContext.broadcast(...)
</code></pre>

<p>However, I get an error that <code>SparkContext</code> does not exist. How can I access it in order to set <code>broadcast</code> variables?</p>
