Some of our data, including hardware status data, is mutable. As such, we need a mechanism for capturing point-in-time data to do things such as analyze voltage drainage over time. Below is the process to create a task in Snowflake that automates the capture of this point in time data:
Identify what tables in Snowflake the mutable data you are interested in lives
Write your query and verify it returns the data you need
Create a history table in the appropriate database. E.g., history tables for point-in-time hardware status live here.
Create a task to run the query from #2 to insert the data
Run the
show tasks;command to verify that your task was created and that the details (cron, query, etc.) are correct. Be sure you have selected the same database and schema that the task was created under.You need to set the task to actually run with the command
alter task YOUR_TASK_NAME resume;