SlideShare a Scribd company logo
1 of 19
Data Loading
Snowflake Data
Loading
•Limited Data
•Bulk Data
•Continuous Data
Limited Data
Done usually using Web UI
Small Sets of Data Loading
using GUI Interface
Bulk Data
Done Usually Using Snowsql
Using ETL Tools
Large Files, Parallel Processing
Continuous Data Loading Continuous Stream Data
into Snowflake – Using Snowpipe
Snowflake
Data Loading
Data Loading - Bulk Copy
•Data Loading Into Snowflake
Data Loading - Bulk Copy
Table Stage
• Each table has a Snowflake stage allocated to it by default for storing files
• This stage is a convenient option if your files need to be accessible to multiple users
and only need to be copied into a single table
User Stage
• Each User has a stage allocated by default for storing Files
• All the worksheets are stored in this stage
• Will be accessed by single user
• Will be useful if the same file needs to be copied to multiple tables
• No Setting of File Format Options
Internal
Named Stage
• Internal stages are named database objects that provide the greatest degree of
flexibility for data loading
• Users with the appropriate privileges on the stage can load data into any table.
• Explicitly grant privileges on the stage to one or more roles before users with those
roles can use the stage.
External Stage
• Stage to connect to AWS S3, Azure Blob, GCP Storage
Snowflake
Stages
Viewing
Stages
User Stage
List @~;
Table Stage
List @%mytable
Internal Named Stage
List @my_stage_name
External Stage
List @external_Stage
Data Loading Data & File Formats
92-4, Ground Floor, beside Biryani Zone, Marathahalli, Bengaluru, Karnataka 560037
Data Loading Web UI
LOGIN TO SNOWFLAKE
ACCOUNT
CLICK ON DATABASES MENU CLICK ON TABLE FOR WHICH
YOU HAVE TO LOAD THE DATA
YOU WILL SEE LOAD DATA
MENU ON THE TOP OF TABLE
COLUMN NAMES
SELECT YOUR WAREHOUSE
AND CLICK ON NEXT
SELECT YOUR FILE FOR
LOADING
SELECT FILE FORMAT, IF NOT
CREATED CREATE A FILE
FORMAT (CHOOSE YOUR FILE
FORMAT, NAME IT AND
CREATE IT) AND CLICK ON NEXT
SELECT YOUR LOAD OPTIONS
AND LOAD THE FILE
Data Loading
Bulk Copy
Snowsql
CREATE FILE
FORMAT
CREATE STAGE
OBJECT
STAGE THE DATA
FILES
BULK COPY DATA
INTO TABLES
VERIFY DATA PURGE STAGE
DATA
Data Loading – File Format
Data File Details
File Formats
Uploading
Files To Stage
Put file
://c:windowsemp.csv
@~/myfolder Windows
Put
file:///userstempemp.csv
@~/mystage -- Linux
Querying From
Stage
User Stage :
Select (j.$1) from @~/mystage;
Table Stage :
Select ($1) from @%mytable;
Internal Named Stage :
Select t.$1,t.$2 from @my_stage_name t;
Temporary Stage :
Select t.$1 from @my_temp_stage_name t;
92-4, Ground Floor, beside Biryani Zone, Marathahalli, Bengaluru, Karnataka 560037
Data Loading – Transformation
• Querying From Stage
• Select $1,$2 From <@stage> (file_format=>’file format name’)
• Transformations in Stage
• Loading Subset Of Data
• copy into home_sales(city, zip, sale_date, price) from (select t.$1, t.$2, t.$6, t.$7 from
@mystage/sales.csv.gz t) file_format = (format_name = mycsvformat);
• Include Sequence Columns in Loaded Data
• Include AUTOINCREMENT / IDENTITY Columns in Loaded Data
• create or replace table mytable ( col1 number autoincrement start 1 increment 1, col2 varchar, col3
varchar );
Bulk Copy
Bulk Copy..
Bulk Copy
Copy Command Examples With Out Validation
• Copy into <table Name> From <Stage>
file_format=>file_format ON_ERROR = 'skip_file’
• Copy into <table Name> From <Stage>
file_format=>file_format ON_ERROR = 'abort_statement’
• create or replace table save_copy_errors as select * from
table(validate(mycsvtable, job_id=>'<query_id>'));
Loading With SQL Statement
• COPY INTO EMP FROM (SELECT $1,$2,$3,$4,
TO_DATE($5,'YYYYMMDD'), $6,$7 FROM
@MY_S3_STAGE/ (file_format => 'MY_CSV_FORMAT') )
ON_ERROR = CONTINUE;
Data Loading – Bulk Copy Steps
•Bulk Copy Steps
1. Log into Snowflake using snowsql
• snowsql -a <account Name> - u <user name>
2. Set Database, Virtual Ware house
• Use database <database name>
3. Set Schema
• use schema <Schema Name>
4. View Tables in the Schema Show Tables
• Show stages
5. List User Stage
• list @~;
6. List Named Stage
• list @my_stage;
7. No Stages : Create a Stage / Temporary Stage
Data Loading – Bulk Copy Steps
8. Create Stages
• create or replace stage my_int_stage copy_options = (on_error='skip_file');
• create or replace temporary stage my_temp_int_stage;
• create or replace temporary stage my_int_stage file_format = my_csv_format;
9. List Table Stage
• list @%<table name>
10. View File Formats
• show file formats;
11. Put your file into Stage
• put file://<file Path> <target Stage>
12. View if the File is Staged
• List <Stage Name>
13. Bulk Copy Into Table
• copy into table from @<stage > file_format = csv_format;
Data Loading –
Bulk Copy
Steps
Step 9. Congratulations!
Step 8. Remove the Successfully Loaded Data Files
Step 7. Verify the Loaded Data
Step 6. Resolve Data Load Errors Related to Data Issues
Step 5. Copy Data into the Target Tables
Step 4. List the Staged Files (Optional)
Step 3. Stage the Data Files
Step 2. Create Stage Objects
Step 1. Create File Format Objects

More Related Content

What's hot

Snowflake Company Presentation
Snowflake Company PresentationSnowflake Company Presentation
Snowflake Company PresentationAndrewJiang18
 
Demystifying Data Warehouse as a Service
Demystifying Data Warehouse as a ServiceDemystifying Data Warehouse as a Service
Demystifying Data Warehouse as a ServiceSnowflake Computing
 
An overview of snowflake
An overview of snowflakeAn overview of snowflake
An overview of snowflakeSivakumar Ramar
 
Snowflake: Your Data. No Limits (Session sponsored by Snowflake) - AWS Summit...
Snowflake: Your Data. No Limits (Session sponsored by Snowflake) - AWS Summit...Snowflake: Your Data. No Limits (Session sponsored by Snowflake) - AWS Summit...
Snowflake: Your Data. No Limits (Session sponsored by Snowflake) - AWS Summit...Amazon Web Services
 
Introduction to snowflake
Introduction to snowflakeIntroduction to snowflake
Introduction to snowflakeSunil Gurav
 
Optimize the performance, cost, and value of databases.pptx
Optimize the performance, cost, and value of databases.pptxOptimize the performance, cost, and value of databases.pptx
Optimize the performance, cost, and value of databases.pptxIDERA Software
 
Moving to Databricks & Delta
Moving to Databricks & DeltaMoving to Databricks & Delta
Moving to Databricks & DeltaDatabricks
 
Master the Multi-Clustered Data Warehouse - Snowflake
Master the Multi-Clustered Data Warehouse - SnowflakeMaster the Multi-Clustered Data Warehouse - Snowflake
Master the Multi-Clustered Data Warehouse - SnowflakeMatillion
 
A 30 day plan to start ending your data struggle with Snowflake
A 30 day plan to start ending your data struggle with SnowflakeA 30 day plan to start ending your data struggle with Snowflake
A 30 day plan to start ending your data struggle with SnowflakeSnowflake Computing
 
Snowflake Data Governance
Snowflake Data GovernanceSnowflake Data Governance
Snowflake Data Governancessuser538b022
 
Snowflake Best Practices for Elastic Data Warehousing
Snowflake Best Practices for Elastic Data WarehousingSnowflake Best Practices for Elastic Data Warehousing
Snowflake Best Practices for Elastic Data WarehousingAmazon Web Services
 
Snowflake SnowPro Core Cert CheatSheet.pdf
Snowflake SnowPro Core Cert CheatSheet.pdfSnowflake SnowPro Core Cert CheatSheet.pdf
Snowflake SnowPro Core Cert CheatSheet.pdfDustin Liu
 
Intro to databricks delta lake
 Intro to databricks delta lake Intro to databricks delta lake
Intro to databricks delta lakeMykola Zerniuk
 
Achieving Lakehouse Models with Spark 3.0
Achieving Lakehouse Models with Spark 3.0Achieving Lakehouse Models with Spark 3.0
Achieving Lakehouse Models with Spark 3.0Databricks
 
Get Savvy with Snowflake
Get Savvy with SnowflakeGet Savvy with Snowflake
Get Savvy with SnowflakeMatillion
 
Big data architectures and the data lake
Big data architectures and the data lakeBig data architectures and the data lake
Big data architectures and the data lakeJames Serra
 
How to Take Advantage of an Enterprise Data Warehouse in the Cloud
How to Take Advantage of an Enterprise Data Warehouse in the CloudHow to Take Advantage of an Enterprise Data Warehouse in the Cloud
How to Take Advantage of an Enterprise Data Warehouse in the CloudDenodo
 
NOVA SQL User Group - Azure Synapse Analytics Overview - May 2020
NOVA SQL User Group - Azure Synapse Analytics Overview -  May 2020NOVA SQL User Group - Azure Synapse Analytics Overview -  May 2020
NOVA SQL User Group - Azure Synapse Analytics Overview - May 2020Timothy McAliley
 

What's hot (20)

Snowflake Company Presentation
Snowflake Company PresentationSnowflake Company Presentation
Snowflake Company Presentation
 
Demystifying Data Warehouse as a Service
Demystifying Data Warehouse as a ServiceDemystifying Data Warehouse as a Service
Demystifying Data Warehouse as a Service
 
An overview of snowflake
An overview of snowflakeAn overview of snowflake
An overview of snowflake
 
Snowflake: Your Data. No Limits (Session sponsored by Snowflake) - AWS Summit...
Snowflake: Your Data. No Limits (Session sponsored by Snowflake) - AWS Summit...Snowflake: Your Data. No Limits (Session sponsored by Snowflake) - AWS Summit...
Snowflake: Your Data. No Limits (Session sponsored by Snowflake) - AWS Summit...
 
Introduction to snowflake
Introduction to snowflakeIntroduction to snowflake
Introduction to snowflake
 
Optimize the performance, cost, and value of databases.pptx
Optimize the performance, cost, and value of databases.pptxOptimize the performance, cost, and value of databases.pptx
Optimize the performance, cost, and value of databases.pptx
 
Moving to Databricks & Delta
Moving to Databricks & DeltaMoving to Databricks & Delta
Moving to Databricks & Delta
 
Snowflake Overview
Snowflake OverviewSnowflake Overview
Snowflake Overview
 
Master the Multi-Clustered Data Warehouse - Snowflake
Master the Multi-Clustered Data Warehouse - SnowflakeMaster the Multi-Clustered Data Warehouse - Snowflake
Master the Multi-Clustered Data Warehouse - Snowflake
 
A 30 day plan to start ending your data struggle with Snowflake
A 30 day plan to start ending your data struggle with SnowflakeA 30 day plan to start ending your data struggle with Snowflake
A 30 day plan to start ending your data struggle with Snowflake
 
Snowflake Data Governance
Snowflake Data GovernanceSnowflake Data Governance
Snowflake Data Governance
 
Snowflake Best Practices for Elastic Data Warehousing
Snowflake Best Practices for Elastic Data WarehousingSnowflake Best Practices for Elastic Data Warehousing
Snowflake Best Practices for Elastic Data Warehousing
 
Snowflake SnowPro Core Cert CheatSheet.pdf
Snowflake SnowPro Core Cert CheatSheet.pdfSnowflake SnowPro Core Cert CheatSheet.pdf
Snowflake SnowPro Core Cert CheatSheet.pdf
 
Intro to databricks delta lake
 Intro to databricks delta lake Intro to databricks delta lake
Intro to databricks delta lake
 
Elastic Data Warehousing
Elastic Data WarehousingElastic Data Warehousing
Elastic Data Warehousing
 
Achieving Lakehouse Models with Spark 3.0
Achieving Lakehouse Models with Spark 3.0Achieving Lakehouse Models with Spark 3.0
Achieving Lakehouse Models with Spark 3.0
 
Get Savvy with Snowflake
Get Savvy with SnowflakeGet Savvy with Snowflake
Get Savvy with Snowflake
 
Big data architectures and the data lake
Big data architectures and the data lakeBig data architectures and the data lake
Big data architectures and the data lake
 
How to Take Advantage of an Enterprise Data Warehouse in the Cloud
How to Take Advantage of an Enterprise Data Warehouse in the CloudHow to Take Advantage of an Enterprise Data Warehouse in the Cloud
How to Take Advantage of an Enterprise Data Warehouse in the Cloud
 
NOVA SQL User Group - Azure Synapse Analytics Overview - May 2020
NOVA SQL User Group - Azure Synapse Analytics Overview -  May 2020NOVA SQL User Group - Azure Synapse Analytics Overview -  May 2020
NOVA SQL User Group - Azure Synapse Analytics Overview - May 2020
 

Similar to Snowflake Data Loading.pptx

All course slides.pdf
All course slides.pdfAll course slides.pdf
All course slides.pdfssuser98bffa1
 
PostgreSQL Database Slides
PostgreSQL Database SlidesPostgreSQL Database Slides
PostgreSQL Database Slidesmetsarin
 
Load & Unload Data TO and FROM Snowflake (By Faysal Shaarani)
Load & Unload Data TO and FROM Snowflake (By Faysal Shaarani)Load & Unload Data TO and FROM Snowflake (By Faysal Shaarani)
Load & Unload Data TO and FROM Snowflake (By Faysal Shaarani)Faysal Shaarani (MBA)
 
Take your database source code and data under control
Take your database source code and data under controlTake your database source code and data under control
Take your database source code and data under controlMarcin Przepiórowski
 
Changing platforms of Oracle database
Changing platforms of Oracle databaseChanging platforms of Oracle database
Changing platforms of Oracle databasePawanbir Singh
 
SQL Server 2012 - FileTables
SQL Server 2012 - FileTables SQL Server 2012 - FileTables
SQL Server 2012 - FileTables Sperasoft
 
data loading and unloading in IBM Netezza by www.etraining.guru
data loading and unloading in IBM Netezza by www.etraining.gurudata loading and unloading in IBM Netezza by www.etraining.guru
data loading and unloading in IBM Netezza by www.etraining.guruRavikumar Nandigam
 
oracle upgradation
oracle upgradationoracle upgradation
oracle upgradationinfluxbob
 
MySQL Audit using Percona audit plugin and ELK
MySQL Audit using Percona audit plugin and ELKMySQL Audit using Percona audit plugin and ELK
MySQL Audit using Percona audit plugin and ELKYoungHeon (Roy) Kim
 
Multiple Flat Files(CSV) to Target Table in ODI12c(12.2.1.0.0)
Multiple Flat Files(CSV) to Target Table in ODI12c(12.2.1.0.0)Multiple Flat Files(CSV) to Target Table in ODI12c(12.2.1.0.0)
Multiple Flat Files(CSV) to Target Table in ODI12c(12.2.1.0.0)Darshankumar Prajapati
 
KoprowskiT_PASSEastMidsFEB16_2AMaDisasterJustBegan
KoprowskiT_PASSEastMidsFEB16_2AMaDisasterJustBeganKoprowskiT_PASSEastMidsFEB16_2AMaDisasterJustBegan
KoprowskiT_PASSEastMidsFEB16_2AMaDisasterJustBeganTobias Koprowski
 
SQLMAP Tool Usage - A Heads Up
SQLMAP Tool Usage - A  Heads UpSQLMAP Tool Usage - A  Heads Up
SQLMAP Tool Usage - A Heads UpMindfire Solutions
 
Liquibase migration for data bases
Liquibase migration for data basesLiquibase migration for data bases
Liquibase migration for data basesRoman Uholnikov
 
Backup and Recovery
Backup and RecoveryBackup and Recovery
Backup and RecoveryAnar Godjaev
 
R12 d49656 gc10-apps dba 01
R12 d49656 gc10-apps dba 01R12 d49656 gc10-apps dba 01
R12 d49656 gc10-apps dba 01zeesniper
 

Similar to Snowflake Data Loading.pptx (20)

All course slides.pdf
All course slides.pdfAll course slides.pdf
All course slides.pdf
 
PostgreSQL Database Slides
PostgreSQL Database SlidesPostgreSQL Database Slides
PostgreSQL Database Slides
 
Less17 Util
Less17  UtilLess17  Util
Less17 Util
 
Load & Unload Data TO and FROM Snowflake (By Faysal Shaarani)
Load & Unload Data TO and FROM Snowflake (By Faysal Shaarani)Load & Unload Data TO and FROM Snowflake (By Faysal Shaarani)
Load & Unload Data TO and FROM Snowflake (By Faysal Shaarani)
 
Android Data Storagefinal
Android Data StoragefinalAndroid Data Storagefinal
Android Data Storagefinal
 
Take your database source code and data under control
Take your database source code and data under controlTake your database source code and data under control
Take your database source code and data under control
 
Changing platforms of Oracle database
Changing platforms of Oracle databaseChanging platforms of Oracle database
Changing platforms of Oracle database
 
SQL Server 2012 - FileTables
SQL Server 2012 - FileTables SQL Server 2012 - FileTables
SQL Server 2012 - FileTables
 
data loading and unloading in IBM Netezza by www.etraining.guru
data loading and unloading in IBM Netezza by www.etraining.gurudata loading and unloading in IBM Netezza by www.etraining.guru
data loading and unloading in IBM Netezza by www.etraining.guru
 
Sqllite
SqlliteSqllite
Sqllite
 
oracle upgradation
oracle upgradationoracle upgradation
oracle upgradation
 
MySQL Audit using Percona audit plugin and ELK
MySQL Audit using Percona audit plugin and ELKMySQL Audit using Percona audit plugin and ELK
MySQL Audit using Percona audit plugin and ELK
 
introduction-stata.pptx
introduction-stata.pptxintroduction-stata.pptx
introduction-stata.pptx
 
Multiple Flat Files(CSV) to Target Table in ODI12c(12.2.1.0.0)
Multiple Flat Files(CSV) to Target Table in ODI12c(12.2.1.0.0)Multiple Flat Files(CSV) to Target Table in ODI12c(12.2.1.0.0)
Multiple Flat Files(CSV) to Target Table in ODI12c(12.2.1.0.0)
 
KoprowskiT_PASSEastMidsFEB16_2AMaDisasterJustBegan
KoprowskiT_PASSEastMidsFEB16_2AMaDisasterJustBeganKoprowskiT_PASSEastMidsFEB16_2AMaDisasterJustBegan
KoprowskiT_PASSEastMidsFEB16_2AMaDisasterJustBegan
 
SQLMAP Tool Usage - A Heads Up
SQLMAP Tool Usage - A  Heads UpSQLMAP Tool Usage - A  Heads Up
SQLMAP Tool Usage - A Heads Up
 
Liquibase migration for data bases
Liquibase migration for data basesLiquibase migration for data bases
Liquibase migration for data bases
 
Backup and Recovery
Backup and RecoveryBackup and Recovery
Backup and Recovery
 
Php basics
Php basicsPhp basics
Php basics
 
R12 d49656 gc10-apps dba 01
R12 d49656 gc10-apps dba 01R12 d49656 gc10-apps dba 01
R12 d49656 gc10-apps dba 01
 

Recently uploaded

Decoding the Heart: Student Presentation on Heart Attack Prediction with Data...
Decoding the Heart: Student Presentation on Heart Attack Prediction with Data...Decoding the Heart: Student Presentation on Heart Attack Prediction with Data...
Decoding the Heart: Student Presentation on Heart Attack Prediction with Data...Boston Institute of Analytics
 
Defining Constituents, Data Vizzes and Telling a Data Story
Defining Constituents, Data Vizzes and Telling a Data StoryDefining Constituents, Data Vizzes and Telling a Data Story
Defining Constituents, Data Vizzes and Telling a Data StoryJeremy Anderson
 
wepik-insightful-infographics-a-data-visualization-overview-20240401133220kwr...
wepik-insightful-infographics-a-data-visualization-overview-20240401133220kwr...wepik-insightful-infographics-a-data-visualization-overview-20240401133220kwr...
wepik-insightful-infographics-a-data-visualization-overview-20240401133220kwr...KarteekMane1
 
Decoding Patterns: Customer Churn Prediction Data Analysis Project
Decoding Patterns: Customer Churn Prediction Data Analysis ProjectDecoding Patterns: Customer Churn Prediction Data Analysis Project
Decoding Patterns: Customer Churn Prediction Data Analysis ProjectBoston Institute of Analytics
 
Digital Marketing Plan, how digital marketing works
Digital Marketing Plan, how digital marketing worksDigital Marketing Plan, how digital marketing works
Digital Marketing Plan, how digital marketing worksdeepakthakur548787
 
Easter Eggs From Star Wars and in cars 1 and 2
Easter Eggs From Star Wars and in cars 1 and 2Easter Eggs From Star Wars and in cars 1 and 2
Easter Eggs From Star Wars and in cars 1 and 217djon017
 
Learn How Data Science Changes Our World
Learn How Data Science Changes Our WorldLearn How Data Science Changes Our World
Learn How Data Science Changes Our WorldEduminds Learning
 
Semantic Shed - Squashing and Squeezing.pptx
Semantic Shed - Squashing and Squeezing.pptxSemantic Shed - Squashing and Squeezing.pptx
Semantic Shed - Squashing and Squeezing.pptxMike Bennett
 
Bank Loan Approval Analysis: A Comprehensive Data Analysis Project
Bank Loan Approval Analysis: A Comprehensive Data Analysis ProjectBank Loan Approval Analysis: A Comprehensive Data Analysis Project
Bank Loan Approval Analysis: A Comprehensive Data Analysis ProjectBoston Institute of Analytics
 
Conf42-LLM_Adding Generative AI to Real-Time Streaming Pipelines
Conf42-LLM_Adding Generative AI to Real-Time Streaming PipelinesConf42-LLM_Adding Generative AI to Real-Time Streaming Pipelines
Conf42-LLM_Adding Generative AI to Real-Time Streaming PipelinesTimothy Spann
 
NO1 Certified Black Magic Specialist Expert Amil baba in Lahore Islamabad Raw...
NO1 Certified Black Magic Specialist Expert Amil baba in Lahore Islamabad Raw...NO1 Certified Black Magic Specialist Expert Amil baba in Lahore Islamabad Raw...
NO1 Certified Black Magic Specialist Expert Amil baba in Lahore Islamabad Raw...Amil Baba Dawood bangali
 
Data Analysis Project : Targeting the Right Customers, Presentation on Bank M...
Data Analysis Project : Targeting the Right Customers, Presentation on Bank M...Data Analysis Project : Targeting the Right Customers, Presentation on Bank M...
Data Analysis Project : Targeting the Right Customers, Presentation on Bank M...Boston Institute of Analytics
 
Student Profile Sample report on improving academic performance by uniting gr...
Student Profile Sample report on improving academic performance by uniting gr...Student Profile Sample report on improving academic performance by uniting gr...
Student Profile Sample report on improving academic performance by uniting gr...Seán Kennedy
 
Student profile product demonstration on grades, ability, well-being and mind...
Student profile product demonstration on grades, ability, well-being and mind...Student profile product demonstration on grades, ability, well-being and mind...
Student profile product demonstration on grades, ability, well-being and mind...Seán Kennedy
 
The Power of Data-Driven Storytelling_ Unveiling the Layers of Insight.pptx
The Power of Data-Driven Storytelling_ Unveiling the Layers of Insight.pptxThe Power of Data-Driven Storytelling_ Unveiling the Layers of Insight.pptx
The Power of Data-Driven Storytelling_ Unveiling the Layers of Insight.pptxTasha Penwell
 
English-8-Q4-W3-Synthesizing-Essential-Information-From-Various-Sources-1.pdf
English-8-Q4-W3-Synthesizing-Essential-Information-From-Various-Sources-1.pdfEnglish-8-Q4-W3-Synthesizing-Essential-Information-From-Various-Sources-1.pdf
English-8-Q4-W3-Synthesizing-Essential-Information-From-Various-Sources-1.pdfblazblazml
 
Principles and Practices of Data Visualization
Principles and Practices of Data VisualizationPrinciples and Practices of Data Visualization
Principles and Practices of Data VisualizationKianJazayeri1
 
SMOTE and K-Fold Cross Validation-Presentation.pptx
SMOTE and K-Fold Cross Validation-Presentation.pptxSMOTE and K-Fold Cross Validation-Presentation.pptx
SMOTE and K-Fold Cross Validation-Presentation.pptxHaritikaChhatwal1
 

Recently uploaded (20)

Decoding the Heart: Student Presentation on Heart Attack Prediction with Data...
Decoding the Heart: Student Presentation on Heart Attack Prediction with Data...Decoding the Heart: Student Presentation on Heart Attack Prediction with Data...
Decoding the Heart: Student Presentation on Heart Attack Prediction with Data...
 
Defining Constituents, Data Vizzes and Telling a Data Story
Defining Constituents, Data Vizzes and Telling a Data StoryDefining Constituents, Data Vizzes and Telling a Data Story
Defining Constituents, Data Vizzes and Telling a Data Story
 
wepik-insightful-infographics-a-data-visualization-overview-20240401133220kwr...
wepik-insightful-infographics-a-data-visualization-overview-20240401133220kwr...wepik-insightful-infographics-a-data-visualization-overview-20240401133220kwr...
wepik-insightful-infographics-a-data-visualization-overview-20240401133220kwr...
 
Decoding Patterns: Customer Churn Prediction Data Analysis Project
Decoding Patterns: Customer Churn Prediction Data Analysis ProjectDecoding Patterns: Customer Churn Prediction Data Analysis Project
Decoding Patterns: Customer Churn Prediction Data Analysis Project
 
Digital Marketing Plan, how digital marketing works
Digital Marketing Plan, how digital marketing worksDigital Marketing Plan, how digital marketing works
Digital Marketing Plan, how digital marketing works
 
Easter Eggs From Star Wars and in cars 1 and 2
Easter Eggs From Star Wars and in cars 1 and 2Easter Eggs From Star Wars and in cars 1 and 2
Easter Eggs From Star Wars and in cars 1 and 2
 
Learn How Data Science Changes Our World
Learn How Data Science Changes Our WorldLearn How Data Science Changes Our World
Learn How Data Science Changes Our World
 
Semantic Shed - Squashing and Squeezing.pptx
Semantic Shed - Squashing and Squeezing.pptxSemantic Shed - Squashing and Squeezing.pptx
Semantic Shed - Squashing and Squeezing.pptx
 
Bank Loan Approval Analysis: A Comprehensive Data Analysis Project
Bank Loan Approval Analysis: A Comprehensive Data Analysis ProjectBank Loan Approval Analysis: A Comprehensive Data Analysis Project
Bank Loan Approval Analysis: A Comprehensive Data Analysis Project
 
Conf42-LLM_Adding Generative AI to Real-Time Streaming Pipelines
Conf42-LLM_Adding Generative AI to Real-Time Streaming PipelinesConf42-LLM_Adding Generative AI to Real-Time Streaming Pipelines
Conf42-LLM_Adding Generative AI to Real-Time Streaming Pipelines
 
NO1 Certified Black Magic Specialist Expert Amil baba in Lahore Islamabad Raw...
NO1 Certified Black Magic Specialist Expert Amil baba in Lahore Islamabad Raw...NO1 Certified Black Magic Specialist Expert Amil baba in Lahore Islamabad Raw...
NO1 Certified Black Magic Specialist Expert Amil baba in Lahore Islamabad Raw...
 
Data Analysis Project : Targeting the Right Customers, Presentation on Bank M...
Data Analysis Project : Targeting the Right Customers, Presentation on Bank M...Data Analysis Project : Targeting the Right Customers, Presentation on Bank M...
Data Analysis Project : Targeting the Right Customers, Presentation on Bank M...
 
Student Profile Sample report on improving academic performance by uniting gr...
Student Profile Sample report on improving academic performance by uniting gr...Student Profile Sample report on improving academic performance by uniting gr...
Student Profile Sample report on improving academic performance by uniting gr...
 
Data Analysis Project: Stroke Prediction
Data Analysis Project: Stroke PredictionData Analysis Project: Stroke Prediction
Data Analysis Project: Stroke Prediction
 
Student profile product demonstration on grades, ability, well-being and mind...
Student profile product demonstration on grades, ability, well-being and mind...Student profile product demonstration on grades, ability, well-being and mind...
Student profile product demonstration on grades, ability, well-being and mind...
 
The Power of Data-Driven Storytelling_ Unveiling the Layers of Insight.pptx
The Power of Data-Driven Storytelling_ Unveiling the Layers of Insight.pptxThe Power of Data-Driven Storytelling_ Unveiling the Layers of Insight.pptx
The Power of Data-Driven Storytelling_ Unveiling the Layers of Insight.pptx
 
English-8-Q4-W3-Synthesizing-Essential-Information-From-Various-Sources-1.pdf
English-8-Q4-W3-Synthesizing-Essential-Information-From-Various-Sources-1.pdfEnglish-8-Q4-W3-Synthesizing-Essential-Information-From-Various-Sources-1.pdf
English-8-Q4-W3-Synthesizing-Essential-Information-From-Various-Sources-1.pdf
 
Principles and Practices of Data Visualization
Principles and Practices of Data VisualizationPrinciples and Practices of Data Visualization
Principles and Practices of Data Visualization
 
Insurance Churn Prediction Data Analysis Project
Insurance Churn Prediction Data Analysis ProjectInsurance Churn Prediction Data Analysis Project
Insurance Churn Prediction Data Analysis Project
 
SMOTE and K-Fold Cross Validation-Presentation.pptx
SMOTE and K-Fold Cross Validation-Presentation.pptxSMOTE and K-Fold Cross Validation-Presentation.pptx
SMOTE and K-Fold Cross Validation-Presentation.pptx
 

Snowflake Data Loading.pptx

  • 1. Data Loading Snowflake Data Loading •Limited Data •Bulk Data •Continuous Data Limited Data Done usually using Web UI Small Sets of Data Loading using GUI Interface Bulk Data Done Usually Using Snowsql Using ETL Tools Large Files, Parallel Processing Continuous Data Loading Continuous Stream Data into Snowflake – Using Snowpipe Snowflake Data Loading
  • 2. Data Loading - Bulk Copy •Data Loading Into Snowflake
  • 3. Data Loading - Bulk Copy
  • 4. Table Stage • Each table has a Snowflake stage allocated to it by default for storing files • This stage is a convenient option if your files need to be accessible to multiple users and only need to be copied into a single table User Stage • Each User has a stage allocated by default for storing Files • All the worksheets are stored in this stage • Will be accessed by single user • Will be useful if the same file needs to be copied to multiple tables • No Setting of File Format Options Internal Named Stage • Internal stages are named database objects that provide the greatest degree of flexibility for data loading • Users with the appropriate privileges on the stage can load data into any table. • Explicitly grant privileges on the stage to one or more roles before users with those roles can use the stage. External Stage • Stage to connect to AWS S3, Azure Blob, GCP Storage Snowflake Stages
  • 5. Viewing Stages User Stage List @~; Table Stage List @%mytable Internal Named Stage List @my_stage_name External Stage List @external_Stage
  • 6. Data Loading Data & File Formats 92-4, Ground Floor, beside Biryani Zone, Marathahalli, Bengaluru, Karnataka 560037
  • 7. Data Loading Web UI LOGIN TO SNOWFLAKE ACCOUNT CLICK ON DATABASES MENU CLICK ON TABLE FOR WHICH YOU HAVE TO LOAD THE DATA YOU WILL SEE LOAD DATA MENU ON THE TOP OF TABLE COLUMN NAMES SELECT YOUR WAREHOUSE AND CLICK ON NEXT SELECT YOUR FILE FOR LOADING SELECT FILE FORMAT, IF NOT CREATED CREATE A FILE FORMAT (CHOOSE YOUR FILE FORMAT, NAME IT AND CREATE IT) AND CLICK ON NEXT SELECT YOUR LOAD OPTIONS AND LOAD THE FILE
  • 8. Data Loading Bulk Copy Snowsql CREATE FILE FORMAT CREATE STAGE OBJECT STAGE THE DATA FILES BULK COPY DATA INTO TABLES VERIFY DATA PURGE STAGE DATA
  • 9. Data Loading – File Format Data File Details
  • 11. Uploading Files To Stage Put file ://c:windowsemp.csv @~/myfolder Windows Put file:///userstempemp.csv @~/mystage -- Linux
  • 12. Querying From Stage User Stage : Select (j.$1) from @~/mystage; Table Stage : Select ($1) from @%mytable; Internal Named Stage : Select t.$1,t.$2 from @my_stage_name t; Temporary Stage : Select t.$1 from @my_temp_stage_name t; 92-4, Ground Floor, beside Biryani Zone, Marathahalli, Bengaluru, Karnataka 560037
  • 13. Data Loading – Transformation • Querying From Stage • Select $1,$2 From <@stage> (file_format=>’file format name’) • Transformations in Stage • Loading Subset Of Data • copy into home_sales(city, zip, sale_date, price) from (select t.$1, t.$2, t.$6, t.$7 from @mystage/sales.csv.gz t) file_format = (format_name = mycsvformat); • Include Sequence Columns in Loaded Data • Include AUTOINCREMENT / IDENTITY Columns in Loaded Data • create or replace table mytable ( col1 number autoincrement start 1 increment 1, col2 varchar, col3 varchar );
  • 16. Bulk Copy Copy Command Examples With Out Validation • Copy into <table Name> From <Stage> file_format=>file_format ON_ERROR = 'skip_file’ • Copy into <table Name> From <Stage> file_format=>file_format ON_ERROR = 'abort_statement’ • create or replace table save_copy_errors as select * from table(validate(mycsvtable, job_id=>'<query_id>')); Loading With SQL Statement • COPY INTO EMP FROM (SELECT $1,$2,$3,$4, TO_DATE($5,'YYYYMMDD'), $6,$7 FROM @MY_S3_STAGE/ (file_format => 'MY_CSV_FORMAT') ) ON_ERROR = CONTINUE;
  • 17. Data Loading – Bulk Copy Steps •Bulk Copy Steps 1. Log into Snowflake using snowsql • snowsql -a <account Name> - u <user name> 2. Set Database, Virtual Ware house • Use database <database name> 3. Set Schema • use schema <Schema Name> 4. View Tables in the Schema Show Tables • Show stages 5. List User Stage • list @~; 6. List Named Stage • list @my_stage; 7. No Stages : Create a Stage / Temporary Stage
  • 18. Data Loading – Bulk Copy Steps 8. Create Stages • create or replace stage my_int_stage copy_options = (on_error='skip_file'); • create or replace temporary stage my_temp_int_stage; • create or replace temporary stage my_int_stage file_format = my_csv_format; 9. List Table Stage • list @%<table name> 10. View File Formats • show file formats; 11. Put your file into Stage • put file://<file Path> <target Stage> 12. View if the File is Staged • List <Stage Name> 13. Bulk Copy Into Table • copy into table from @<stage > file_format = csv_format;
  • 19. Data Loading – Bulk Copy Steps Step 9. Congratulations! Step 8. Remove the Successfully Loaded Data Files Step 7. Verify the Loaded Data Step 6. Resolve Data Load Errors Related to Data Issues Step 5. Copy Data into the Target Tables Step 4. List the Staged Files (Optional) Step 3. Stage the Data Files Step 2. Create Stage Objects Step 1. Create File Format Objects