Before loading the data from your Source(s) System(s) to your Snowflake Target System, please:
You are now ready to load the data.
Load the data
To load the data:
- Open Snowflake
- Open the Worksheet Helper_Snowflake. It contains 3 parts
- Load the data
- Monitor the execution
- Suspend the root Task
- Select the 3 lines of the Load the data part and execute them: the root task to load the data is launched
Be careful: The root task will be executed every 5 minutes by default.
You can change this in the Load Control script creation:
CREATE OR REPLACE TASK LOAD_SNOWFLAKE1_4_0DATAVAULTANDMART_ROOT_TASK
WAREHOUSE = TRAINING_WH_461345104558
SCHEDULE = '5 minute'
ALLOW_OVERLAPPING_EXECUTION = FALSE
SUSPEND_TASK_AFTER_NUM_FAILURES = 3
AS
BEGIN
LET start_time VARCHAR := TO_VARCHAR(CONVERT_TIMEZONE('UTC', CURRENT_TIMESTAMP()))::VARCHAR;
CALL system$set_return_value(:start_time);
END;
- You can monitor the load execution with the Monitor the execution part. For example, just after the load data launch, you will have only the root task scheduled:
- After the completion of the load, the root task and all the child tasks will be completed:
- After completing the load in testing mode, please suspend the root task to avoid additional costs in Snowflake execution. For this, execute the Suspend the root Task part.
- You can now check that your data were correctly loaded with the following script:
USE DATABASE IDENTIFIER('<Name of your target database>');
SELECT table_schema AS table_schema
, table_name AS schema_table
, table_type AS table_type
, row_count AS rows_count
FROM information_schema.tables
WHERE table_type = 'BASE TABLE'
AND table_schema IN ('SA','RDV','BV','DM')
ORDER BY row_count;