What is a TASK object in Snowflake? What does it do?

1.77K viewsSnowflake Streams and Tasks
0

What is a TASK object in Snowflake? What does it do?

Frank Bell Answered question April 10, 2022
0

If you are familiar with cronjobs, I view Snowflake Tasks as kind of similar. When TASKS were introduced in ____ with Streams I was kind of surprised because I thought Snowflake kind of was starting to compete at a very basic level with all of their EL and ELT partners including [ list partners here ]. The combination of streams and tasks allows for basic data pipeline creation in Snowflake without any of the many EL and ELT tools and companiues. The task, similar to a cronjob, can kick off an operation and execution of a SQL statement or SQL procedure at a specific time. It actually uses the same crontab type syntax for Tasks that are scheduled. Tasks also though can be started based upon a depency of another task so that you have a true task by task hiearchy where the NEXT task will execute ONLY when the task its dependent has completed. Also, tasks do NOT have to all be sequential. Technically, you can have I assume hundreds of subtasks I’ll call them dependent on the SAME exact parent task and they can all EXECUTE in parallel if you have enough Snowflake compute resources running at the time. One other point to note is you can configure a task to NOT run again if the same task is still running. For example, let’s say your task is running every 5 minutes but one time it goes to 6 minutes. In this scenario, the task will not be initiated but skipped until the next execution at 4 minutes later. ALSO, PRO TIP which if you forget is COMPLETELY annoying. YOU MUST ALTER A TASK BEFORE it is ACTIVE! If you forget this STEP than perfectly CREATED TASK will NEVER EVER RUN!

Frank Bell Answered question April 10, 2022
You are viewing 1 out of 1 answers, click here to view all answers.