Reputation: 95
I have a task running on a table 'original_table' for every five minutes in snowflake .
I am taking a backup for some reason in another table 'back_up_table' . I need to perform swap for 'original_table' with 'back_up_table'
Do I have to pause task on 'original_table' before swap and then resume it?
Upvotes: 1
Views: 182
Reputation: 2880
Short answer, no, there's nothing technically requiring that you stop the task
However, depending on what you are doing, you may get some unexpected results. For example, if the task is actively running a Insert when the swap happens you may have a bit of a race condition and it will be unpredictable as to which table gets that new record.
If the task is doing something more complicated, like if it is also creating/swapping tables, you could get an error in the task or some truly weird results that would be hard to troubleshoot.
So if your task is able to recover after a failure on follow-up runs, and you're not worried about transient results/race conditions, then It's probably fine to leave it running.
Edit: as other comments suggested. For backing up tables, you might want to look into the Clone feature if you haven't already for a possibly cleaner overall solution.
Upvotes: 1