Forum Discussion
Copy data activity not overwriting
We have pipelines that have been running for months without issue. Overnight some copy data activities from lakehouse to lakehouse are now appending rather than overwriting data. The copy data activies haven't been edited, they are still set to overwrite however data is being appended.
Has anyone else experienced this?
15 Replies
- Anon290New Member
I heard the same. Overwrite has been changed to Overwrite schema.
Also any of you facing this issue where in once you load the data, the sql endpoint still shows older version of data?
This is frustrating.
- frithjof_vCommunity Champion
Ref. old data in SQL Analytics Endpoint:
- Richard_100Resolver I
Yes, I discovered this today. Can confirm that changing the JSON to Overwrite from OverwriteSchema works.
For me, it applies only to lakehouse-to-lakehouse Copy Data activities.
I have lots of Copy Data pipelines connected to on-premise DB via a gateway and I've just tested one and the overwriting action works correctly despite the JSON code being "OverwriteSchema".
However, I've just set up a new Copy Data to copy a table from one lakehouse to another, i.e. totally internal to Fabric, and this appends rather than overwrites as per OP's post. I change "OverwriteSchema" to "Overwrite" in the JSON and it works correctly again.
It's like there's a disconnect between the UI and the JSON. This is a dreadful bug.
- Richard_100Resolver I
I have retested this just now and overwrite is working as you'd expect, they have fixed this
- AnonymousNot applicable
Hi alynch ,
As I understand your query, the issue you are facing is that the data is getting overwritten after every iteration of copy activity inside foreach. Please let me know if my understanding is incorrect.
If you would like to write all data to a single file from multiple sources then you will have to copy the files for each iteration to an intermediate folder by appending datetime to the filename ( using parameterized dataset at the sink) and then once all the iterations are completed then have another subsequent copy activity outside of your ForEach activity and point it's source to the intermediate folder and in sink point to your desired file store and then use copyBehavior as MergeFiles in copy activity settings.
You can learn more about it in this document: Copy data from/to a file system - Azure Data Factory & Azure Synapse | Microsoft Learn
Best Regards
Yilong Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- GeorgEberleFrequent Visitor
Hi Anonymous
I think the issue is, that the data is not getting overwriting where it should, but appending instead.
- GeorgEberleFrequent Visitor
Hi alynch,
Same issue here. Our overwrite pipelines suddenly startet to append. It startet round-about last Thursday.
- RoryStNew Member
We have also noted some odd behaviour with the Copy Data acivity.
It appears to have started from the 15th August for us. Where data is not being overwritten even though the overwrite option is set.
- alynchAdvocate I
We managed to solve this issue with help from Mictosoft Support. The overwrite option when selected in a copy data activity has been updated to carry out OverwriteSchema.
"OverwriteSchema" action does not delete any data. Instead, it creates a new version of the Delta table with the updated schema, allowing users to leverage the time travel feature to view all previous versions of the table.
To perform an Overwrite, where the current data is completely replaced with the newly copied data, select 'Add dynamic content' for the Table Action and enter 'Overwrite'.
- RoryStNew Member
Thanks for the update. Do you know if there is any documentation on the change? I've been looking here https://learn.microsoft.com/en-us/fabric/data-factory/copy-data-activity but couldn't find anything.