Tasks & Transactions: Snowflake SnowPro Core Certification

Seventeenth Chapter: Tasks & Transactions in Snowflake

Gonzalo Fernandez Plaza
6 min readNov 9, 2021

--

Tasks & Transactions in Snowflake
Tasks & Transactions in Snowflake

We are coming to the end of the Snowflake SnowPro Core course, but we can’t forget about Tasks and Transactions in Snowflake, which will allow us to extend the functionality of our favorite Cloud Data Warehouse. Let’s get to it!

  1. Introduction to tasks
  2. Tree of tasks
  3. Task History
  4. Serverless Tasks
  5. Transactions
  6. Typical Exam Questions

Remember that all the chapters from the course can be found in the following link:

INTRODUCTION TO TASKS

Snowflake tasks are schedulable scripts that are run inside your Snowflake environment. No event source can trigger a task; instead, a task runs on a schedule, which can be defined when creating a task, and they run with the privileges of the task owner. A task can execute a single SQL statement, including a call to a Stored Procedure. This last part is important and usually appears in the Snowflake SnowPro Core Exam.

Snowflake ensures only one instance of a task with a schedule is executed at a given time. If a task is still running when the next scheduled execution time occurs, that scheduled time is skipped. Imagine that we have a task that it’s executed every 5 minutes. If the first execution hasn’t finished by the time the second one should start, Snowflake will skip the second one. Tasks also have a maximum duration of 60 minutes by default. If they haven’t finished by then, they will be automatically terminated.

Execution of task T1 skipped.
Execution of task T1 skipped.

You can also specify a CRON expression and time zone for periodically running a scheduled task. When you first create a task, it will be suspended by default. You can…

--

--

Gonzalo Fernandez Plaza

Computer Science Engineer & Tech Lead 🖥️. Publishing AWS & Snowflake ❄️ courses & exams. https://www.fullcertified.com