2
votes

I have created a simple task with the below script and for some reason it never ran.

CREATE OR REPLACE TASK dbo.tab_update
WAREHOUSE = COMPUTE_WH
SCHEDULE = 'USING CRON * * * * * UTC'
AS CALL dbo.my_procedure();

I am using a snowflake trail enterprise version.

2

2 Answers

3
votes

Did you RESUME? From the docs -- "After creating a task, you must execute ALTER TASK … RESUME before the task will run"

3
votes

A bit of clarification: Both the steps, while possibly annoying are needed.

  1. Tasks can consume warehouse time (credits) repeatedly (e.g. up to every minute) so we wanted to make sure that the execute privilege was granted explicitly to a role.
  2. Tasks can have dependencies and task trees (eventually DAGs) shouldn't start executing as soon as one or more tasks are created. Resume provides an explicit sync point when a data engineer can tell us that the task tree is ready for validation and execution can start at the next interval.

Dinesh Kulkarni (PM, Snowflake)