Given a Snowflake task tree where Task A triggers Task B and Task C, and Task B triggers Task D, which task(s) will run immediately after Task A completes?
Think about which tasks are directly dependent on Task A.
Task B and Task C depend directly on Task A, so they run immediately after Task A completes. Task D depends on Task B, so it runs only after Task B finishes.
You want to design a Snowflake task tree where Task 1 runs first, then Task 2 and Task 3 run in parallel, and finally Task 4 runs after both Task 2 and Task 3 complete. Which dependency setup achieves this?
Consider which tasks must finish before others start.
Setting Task 2 and Task 3 to depend on Task 1 allows them to run in parallel after Task 1 completes. Task 4 depending on both ensures it runs only after both finish.
Examine the following Snowflake task creation statements. Which option correctly identifies the error causing the task tree to fail?
CREATE TASK task_a WAREHOUSE = wh1 AS SELECT 1; CREATE TASK task_b WAREHOUSE = wh1 AFTER task_a AS SELECT 2; CREATE TASK task_c WAREHOUSE = wh1 AFTER task_b AS SELECT 3; CREATE OR REPLACE TASK task_a WAREHOUSE = wh1 AFTER task_c AS SELECT 4;
CREATE TASK task_a WAREHOUSE = wh1 AS SELECT 1; CREATE TASK task_b WAREHOUSE = wh1 AFTER task_a AS SELECT 2; CREATE TASK task_c WAREHOUSE = wh1 AFTER task_b AS SELECT 3; CREATE OR REPLACE TASK task_a WAREHOUSE = wh1 AFTER task_c AS SELECT 4;
Look for loops in the task dependencies.
Task_a depends on task_c, which depends on task_b, which depends on task_a, creating a circular dependency that Snowflake does not allow.
In Snowflake, if a task is created by User A but needs to run SQL statements accessing a secure schema owned by User B, what is the best practice to ensure the task runs successfully?
Consider how task ownership affects privilege inheritance.
Tasks run with the privileges of their owner. Creating the task owned by User B ensures it can access the secure schema owned by User B without extra grants.
You have a complex Snowflake task tree with multiple branches and dependencies. To minimize total execution time, which approach is best?
Think about parallelism and resource allocation.
Running independent tasks in parallel reduces total time. Proper warehouse sizing ensures tasks have enough resources without waste.