Override and Merge mode write using AutoLoader in Databricks

Anonymous
New Contributor III

We are reading files using Autoloader in Databricks. Source system is giving full snapshot of complete data in files. So we want to read the data and write in delta table in override mode so all old data is replaced by the new data. Similarly for other use case, we have requirement to merge and update existing records in delta table.

While Autoloader only supports writing in append mode, is there any option to write in override and merge.

Below is the code we are using for writing in append mode using AutoLoader

 df.writeStream.format("delta").option("mergeSchema", "true").outputMode("append").option("checkpointLocation", checkpointLocation).trigger(once=True).start(deltaLakePath)