Тёмный

Configure Snowpipe with SNS | Snowflake | Big Data 

Knowledge Amplifier
Подписаться 28 тыс.
Просмотров 3,9 тыс.
50% 1

Prerequisite:
--------------------
AWS Lambda and Snowflake integration + automation using Snowpipe | ETL | Lambda Deployment Package
• AWS Lambda and Snowfla...
SQL Queries used:
-------------------------------
drop database if exists s3_to_snowflake;
--Database Creation
create database if not exists s3_to_snowflake;
--Specify the active/current database for the session.
use s3_to_snowflake;
--Specify the role
use role ACCOUNTADMIN;
--Table Creation
create or replace table s3_to_snowflake.PUBLIC.Iris_dataset (Id number(10,0),sepal_length number(10,5) , sepal_width number(10,4),
petal_length number(10,3) , petal_width number(10,4) , CLASS_NAME varchar(20));
--File Format Creation
create or replace file format my_csv_format
type = csv field_delimiter = ',' skip_header = 1
field_optionally_enclosed_by = '"'
null_if = ('NULL', 'null')
empty_field_as_null = true;
--Storage Creation
create or replace storage integration s3_int
TYPE = EXTERNAL_STAGE
STORAGE_PROVIDER = S3
ENABLED = TRUE
STORAGE_AWS_ROLE_ARN = '{}'
STORAGE_ALLOWED_LOCATIONS = ('{}')
COMMENT = '{}' ;
--Describe the Integration Object
DESC INTEGRATION s3_int;
--Stage Creation
create or replace stage s3_to_snowflake.PUBLIC.Snow_stage url="s3://{}"
storage_integration = s3_int;
--Files present in the external stage
list @Snow_stage;
select system$get_aws_sns_iam_policy('{}');
--Create the SNowpipe
create or replace pipe s3_to_snowflake.PUBLIC.spa
auto_ingest=true aws_sns_topic='{}' as copy into s3_to_snowflake.PUBLIC.Iris_dataset from
@s3_to_snowflake.PUBLIC.Snow_stage FILE_FORMAT=(FORMAT_NAME=my_csv_format);
show pipes;
select * from s3_to_snowflake.PUBLIC.Iris_dataset;
select count(*) from s3_to_snowflake.PUBLIC.Iris_dataset;
Check this playlist for more AWS Projects or POC in Big Data domain:
• Demystifying Data Engi...

Опубликовано:

 

12 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 20   
@kushalappabe1993
@kushalappabe1993 Год назад
dude! thank you so much for this, now i can probably stop my brain thinking about the pipeline over and over again. The sns via topic worked like a charm for me!🤓 i was trying with sqs but the pipeline never got established even though all the necessary configs were done as per snowflake documentation, still could'nt find out what went wrong. I would also like to see the same content via sqs if possible. thank you once again! keep up the good work✌
@KnowledgeAmplifier1
@KnowledgeAmplifier1 Год назад
Hello Kushalappa BE , you can refer this video , if you want to implement Snowpipe with SQS -- ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-9hsdnLrx4iE.html Happy Learning
@kushalappabe1993
@kushalappabe1993 Год назад
@@KnowledgeAmplifier1 but according to snowflake documentation there is no need of python, anyways i will refer your link , ✌
@KnowledgeAmplifier1
@KnowledgeAmplifier1 Год назад
@@kushalappabe1993 For snowpipe working , Python is not needed , I added Python to perform some transformation activity in s3 before leading the data in Snowflake using Snowpipe ...
@varunjain2645
@varunjain2645 Год назад
very lucid and concise ..thanks 👍
@KnowledgeAmplifier1
@KnowledgeAmplifier1 Год назад
You are welcome Varun Jain! Happy Learning
@ravikreddy7470
@ravikreddy7470 Год назад
Can you make a video on SNS vs SQS, when should we use what service? Edit: I got the answer from your other video about SQS. Thanks !! :)
@KnowledgeAmplifier1
@KnowledgeAmplifier1 Год назад
Glad to hear that Ravi K R! Happy Learning
@hindukilaru2042
@hindukilaru2042 Год назад
When I added a new record to the file and upload it again to the bucket do i need to run the pipe again or running the select statement is enough?
@vikinist
@vikinist 2 года назад
Nice one but its very fast here
@KnowledgeAmplifier1
@KnowledgeAmplifier1 2 года назад
Sorry for the inconvenience Vikram , actually some part of the topic is similar like snowpipe with SQS setup which I already covered in my previous video , so went bit fast so that it won't appear reiteration of previous video and feel boring 😅 You can decrease the playback speed in setting as per your convenience. To explore more on Snowflake with AWS , you can have a look in this doc --doc.clickup.com/37466271/d/h/13qc4z-104/d4346819bd8d510 Happy Learning :-)
@prashanth.s6540
@prashanth.s6540 2 года назад
Hi ... How to get email notifications or error message for snowpipe data load to snowflake tables
@KnowledgeAmplifier1
@KnowledgeAmplifier1 2 года назад
Hello Prashant , please refer this video -- Snowflake Snowpipe - Email Alert Mechanism ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-7X52Jv2uflo.html Hope this will be helpful! Happy Learning :-)
@balajits9081
@balajits9081 Год назад
Hello your contents are helpful, I need to load the JSON file data to snowflake db using SNS. Please help me on this
@KnowledgeAmplifier1
@KnowledgeAmplifier1 Год назад
Hello balaji ts , first of all, Glad to know the video is helpful to you 😊! Now coming your requirement , hope from this video you understood clearly how to configure Snowpipe using SNS , now all you need to know , how to use Snowpipe to load Json data , for that , you can refer this video -- ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-KCoC9ju-BfE.html , so all you have to do is combine the 2 concepts , that's all. Hope this will be helpful! Happy Learning
@balajits9081
@balajits9081 Год назад
@@KnowledgeAmplifier1 Thanks for your response, the twist is need to trigger the SNS using lamda function. Which means i already created one sns to trigger snowpipe once JSON file arrives on S3 I have another bucket once files arrives there need to run lambda function to call the same SNS..how we can achieve it
@KnowledgeAmplifier1
@KnowledgeAmplifier1 Год назад
@@balajits9081 from the another s3 bucket also , you can send the events to same SNS directly na? do you really need Lambda there?
@balajits9081
@balajits9081 Год назад
@@KnowledgeAmplifier1 yes I need lambda there that is the requirements
@balajits9081
@balajits9081 Год назад
@@KnowledgeAmplifier1 Hi any luck? how we can call SNS using lambda
Далее
Вопрос Ребром - Булкин
59:32
Просмотров 1,1 млн
Cursor Is Beating VS Code (...by forking it)
18:00
Просмотров 95 тыс.
What is Snowflake Snowpipe?
18:11
Просмотров 138