Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Invalid
-
2.4.3
-
None
-
None
Description
I am guessing the bug title will be sufficient explanation of the issue.
below is a little script to illustrate. Running the script gives this error:
> org.apache.spark.sql.AnalysisException: Table `example` already exists.;
spark.sql("drop table if exists example ").show()
case class Person(first: String, last: String, age: Integer)
val df = List(
Person("joe", "x", 9),
Person("fred", "z", 9)).toDF()
df.write.option("mode","overwrite").saveAsTable("example")
val recover1 = spark.read.table("example")
recover1.show()
val df3 = List(
Person("mouse", "x", 9),
Person("golf", "z", 9)).toDF()
df3.write.option("mode","overwrite").saveAsTable("example")
val recover4 = spark.read.table("example")
recover4.show()