Skip to content

Commit

Permalink
use overwrite mode
Browse files Browse the repository at this point in the history
Signed-off-by: Tobias Windisch <tobias.windisch@hs-kempten.de>
  • Loading branch information
windisch committed Dec 13, 2023
1 parent 5bdb0cf commit c833438
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions luisy/targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,10 +252,8 @@ def write(self, df: SparkDataFrame):
Args:
df (pyspark.sql.DataFrame): Dataframe that should be written to delta table
"""
logger.info(f"Drop table {self.table_uri}")
self.spark.sql(f"DROP TABLE IF EXISTS {self.table_uri}")
logger.info(f"Write to {self.table_uri}")
df.write.saveAsTable(self.table_uri)
df.write.mode("overwrite").saveAsTable(self.table_uri)

def read(self):
return self.spark.table(self.table_uri)
Expand Down

0 comments on commit c833438

Please sign in to comment.