我想在从数据帧写入数据表之前删除其中的记录,但这个方法对我不起作用……我做错了什么?
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()
感谢您的选择。
谢谢。