title: Spark 2.3 Dropping Temp Table
body: <p>I'm trying to use <code>dropTempTable()</code> after the respective temporary table's use is over (to free up the memory for next calculations).</p>
  
  <p>Newer Spark Session doesn't need <code>sqlContext</code>, so, it is confusing me on how to use the function.</p>
  
  <p>1) Tried, same DF which I used to register a temp table to do -</p>
  
  <pre><code>DF.dropTempTable('xyz')
  </code></pre>
  
  <p>Didn't work.</p>
  
  <p>2) Tried following way too, as spark internally invokes <code>sqlContext</code> too along with <code>sparkContext</code>, but didn't work -</p>
  
  <pre><code>spark.dropTempTable('xyz')
  </code></pre>
  
  <p>3) Tried <code>spark.catalog</code> to drop, this failed too -</p>
  
  <pre><code>spark.catalog.dropTempTable('xyz')
  </code></pre>
  
  <p>What to do? 1.6 examples on internet are not working in the 2.3 version for <code>dropTempTable()</code>.</p>
  
  <p>Any help?</p>