2

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.

RLT
  • 141
  • 1
  • 2
  • 7

2 Answers2

3

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

waldente
  • 1,324
  • 9
  • 12
  • 1
    Thank you..That helped. However when I use the following, I get error: USE ROLE sysadmin; ALTER TASK dbo.tab_update RESUME; EXECUTE TASK privilege must be granted to owner role – RLT Jan 14 '20 at 00:23
  • 2
    I figured it out, need to change role to "Accountadmin" to make it work. – RLT Jan 14 '20 at 00:30
3

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)

Dinesh
  • 421
  • 2
  • 7