I am connecting with Hive using Spark 2.x and I am running following Spark Query:
spark.sql("""DROP TABLE IF EXISTS db_name.table_name""")
spark.sql("""Create TABLE IF NOT EXISTS db_name.table_name""")
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.
Which Means the condition IF EXISTS and IF NOT EXISTS is not working.
I read it somewhere that there may be data nucleus dependency issue. so Below are the dependencies I am using for Data nucleus:
<dependency>
<groupId>org.datanucleus</groupId>
<artifactId>datanucleus-rdbms</artifactId>
<version>3.2.9</version>
</dependency>
<dependency>
<groupId>org.datanucleus</groupId>
<artifactId>datanucleus-core</artifactId>
<version>3.2.10</version>
</dependency>
<dependency>
<groupId>org.datanucleus</groupId>
<artifactId>datanucleus-api-jdo</artifactId>
<version>3.2.6</version>
</dependency>