title: DROP TABLE IF EXISTS/CREATE TABLE IF NOT EXISTS not working with SparkSQL
body: <p>I am connecting with Hive using Spark 2.x and I am running following Spark Query:</p>
  
  <pre><code>spark.sql("""DROP TABLE IF EXISTS db_name.table_name""")
  spark.sql("""Create TABLE IF NOT EXISTS db_name.table_name""")
  </code></pre>
  
  <p>if the table doesn't exist then the first query gives exception of Table Does not exist.
  If Table exist and I am running the second query in the first place then it throws Table already exists exception.</p>
  
  <p>Which Means the condition IF EXISTS and IF NOT EXISTS is not working.</p>
  
  <p>I read it somewhere that there may be data nucleus dependency issue. so Below are the dependencies I am using for Data nucleus:</p>
  
  <pre><code>&lt;dependency&gt;
              &lt;groupId&gt;org.datanucleus&lt;/groupId&gt;
              &lt;artifactId&gt;datanucleus-rdbms&lt;/artifactId&gt;
              &lt;version&gt;3.2.9&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.datanucleus&lt;/groupId&gt;
              &lt;artifactId&gt;datanucleus-core&lt;/artifactId&gt;
              &lt;version&gt;3.2.10&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.datanucleus&lt;/groupId&gt;
              &lt;artifactId&gt;datanucleus-api-jdo&lt;/artifactId&gt;
              &lt;version&gt;3.2.6&lt;/version&gt;
          &lt;/dependency&gt;
  </code></pre>