How to avoid duplicate records when repairing failed Databricks Jobs?

alondatamvp
Visitor

Suppose a job task successfully writes records to a Delta table but fails while performing a subsequent operation.

When we repair the job, the failed task executes again and potentially inserts the same records.

How do you normally handle such situations in production pipelines?

Is using MERGE instead of append sufficient, or would you recommend maintaining a separate audit table to track completed operations?