I am trying to include schema change for new type and dropped column in Delta tables.As per documentation
As per documentation:
df3
.write
.format("delta")
.mode("overwrite")
.option("mergeSchema", "true")
.save(deltapath)
This way I loose old data. Is there anyway to keep olddata before overwriting with new schema apart from taking backup. I have posted same query in databricks forum,link for your reference: https://community.databricks.com/s/question/0D58Y00009WjZllSAF/what-is-the-best-way-to-take-care-of-drop-and-rename-a-column-in-schema-evaluation
One way is to create a backup of file before overwriting it.But I want to know what is best way.