I tried dropping a table and creating the same table again. But I faced the error mentioned below.
spark.sql("drop table if exists db.tablename") spark.