Sprint_2_unit_testing (1)
Sprint_2_unit_testing (1)
For creating snowpipe we have used MY_S3_STAGE as our external stage and MY_CSV_FORMAT as our
file format.
Using this command, we can check the data that has been loaded by using snowpipe
Testing SCD Type 2:
Step 1. Reviewing all the data types used for creation of Raw table
Step 2. Reviewing all the data types used for creation of Landing table
Step 3. Reviewing all the data types used for creation of Staging table
Step 4. Stream to track changes in staging table and create delta
Task Flow
Flat Files
Raw_table
Landing_table
Landing_Stream
Staging_table
Step 2. Populating data into Raw table with data_v2.csv file using my_loan_internalstage
Step 3. Now we have fresh data in Loan_raw. We will transfer the data from loan_raw to
Loan_landing table using below logic:
Step 4: Previewing the code for creation of role and grant permissions to the role
Schedular task:
We created a table called Bank_loan_analysis8 with structure with respective to the files structure
which are present in the s3 bucket in order to load files data into this created table.
We created a task called mytask_minute . This task will load all the files present in the s3 bucket to
This show tasks command will show all tasks present in entire account.
This alter task mytask_minute resume command will start or resume the task mytask_minute in
order to load files data to bank_loan_analysis8 table.
This alter task mytask_minute suspend command will suspend the task mytask_minute. This will
stop task .
After 2 minutes of execution of alter task mytask_minute resume command
we need to check data loaded into Bank_loan_analysis8 from s3 bucket or not, with this
It takes 2 minutes to load data because we mentioned schedule time equals to 2 minutes.
After getting data loaded into table, we need to suspend the task.
ERROR HANDLING
In this case we created a masking policy where we taken value datatype and return type as integer, but
actually we are applying on parameter which of varchar data type .Thats why we are
getting this error .
Rectification
That error can be resolved by making changes in masking policy by taking value datatype and return type as
varchar as that of parameter datatype on which we applying this masking policy.