在从数据框中将数据写入表之前,我正在尝试从表中删除记录。它不适合我......我做错了什么?
Goal: "delete from xx_files_tbl" before writing new dataframe to table.
query = "(delete from xx_files_tbl)"
spark.write.format("jdbc")\
.option("url", "jdbc:sqlserver://"+server+":1433;databaseName="+db_name)\
.option("driver", driver_name)\
.option("dbtable", query)\
.option("user", user)\
.option("password", password)\
.option("truncate", "true")\
.save()
谢谢。