Task Lineage
In this tutorial we will show how to child and partent tasks so that once the parent run the child will follow. We call this task lineage.
For the official Snowflake documentation this tutorial was based on: https://docs.snowflake.com/en/user-guide/tasks-graphs#create-a-task-graph
Video
Video is still in development.
Requirement
This tutorial assumes you have nothing in your Snowflake account (Trial) and no complex security needs.
Setup
Lets start the setup prcoess in Snowflake.
If you don't have a database, schema or warehouse yet.
use role sysadmin;
-- Create a database to store our schemas.
create database raw;
-- Create the schema. The schema stores all our objectss.
create schema raw.data;
/*
Warehouses are synonymous with the idea of compute
resources in other systems. We will use this
warehouse to call our user defined function.
*/
create warehouse if not exists developer
warehouse_size = xsmall
initially_suspended = true;
use database raw;
use schema data;
use warehouse developer;
First lets start by setting up the table we'll enter data into.
Parent Task
Next lets create a Snowflake notebook named "my_notebook" and enter the sql below.
Child Task
Lets create the child task and resume the task so it runs after our parent task.
You can also see the task linage by going to the parent task in the UI.
Run Task
Lets run the notebook and see that once the task row is added, the notebook row follows.