Reputation: 716
I have a table which get loaded from S3 every time when there is a new file in bucket. And I am using Snowpipe to do so.
However the ask is to refresh the table in every load. To accomplish that, My thought process is below.
So Basically using the Self stream to delete the data from the table. However my issue is what will happen when there is multiple load on the same day. And this approach does not look very professional. Is there a better way.
Upvotes: 1
Views: 1221
Reputation: 674
I would create a new target table for the stream data and merge into this new table on every run. If you really need to delete data from t1 then you could setup a child task that deletes data from t1 based on what you have in t2 (after you have merged)
However, the stream will record these delete operations. Depending on how your load works you could created an append only stream or when ingesting the stream, make sure to use the metadata to filter only the data events you are interested in
Upvotes: 1