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

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
 
Snowflake Data Science and AI/ML at Scale
Snowflake Data Science and AI/ML at ScaleSnowflake Data Science and AI/ML at Scale
Snowflake Data Science and AI/ML at ScaleAdam Doyle
 
Introduction to snowflake
Introduction to snowflakeIntroduction to snowflake
Introduction to snowflakeSunil Gurav
 
Intro to Delta Lake
Intro to Delta LakeIntro to Delta Lake
Intro to Delta LakeDatabricks
 
Snowflake: The Good, the Bad, and the Ugly
Snowflake: The Good, the Bad, and the UglySnowflake: The Good, the Bad, and the Ugly
Snowflake: The Good, the Bad, and the UglyTyler Wishnoff
 
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
 
Demystifying Data Warehouse as a Service
Demystifying Data Warehouse as a ServiceDemystifying Data Warehouse as a Service
Demystifying Data Warehouse as a ServiceSnowflake Computing
 
Snowflake Company Presentation
Snowflake Company PresentationSnowflake Company Presentation
Snowflake Company PresentationAndrewJiang18
 
Introducing the Snowflake Computing Cloud Data Warehouse
Introducing the Snowflake Computing Cloud Data WarehouseIntroducing the Snowflake Computing Cloud Data Warehouse
Introducing the Snowflake Computing Cloud Data WarehouseSnowflake Computing
 
Changing the game with cloud dw
Changing the game with cloud dwChanging the game with cloud dw
Changing the game with cloud dwelephantscale
 
Apache Iceberg - A Table Format for Hige Analytic Datasets
Apache Iceberg - A Table Format for Hige Analytic DatasetsApache Iceberg - A Table Format for Hige Analytic Datasets
Apache Iceberg - A Table Format for Hige Analytic DatasetsAlluxio, Inc.
 
Delta Lake OSS: Create reliable and performant Data Lake by Quentin Ambard
Delta Lake OSS: Create reliable and performant Data Lake by Quentin AmbardDelta Lake OSS: Create reliable and performant Data Lake by Quentin Ambard
Delta Lake OSS: Create reliable and performant Data Lake by Quentin AmbardParis Data Engineers !
 
Making Data Timelier and More Reliable with Lakehouse Technology
Making Data Timelier and More Reliable with Lakehouse TechnologyMaking Data Timelier and More Reliable with Lakehouse Technology
Making Data Timelier and More Reliable with Lakehouse TechnologyMatei Zaharia
 
Snowflake + Power BI: Cloud Analytics for Everyone
Snowflake + Power BI: Cloud Analytics for EveryoneSnowflake + Power BI: Cloud Analytics for Everyone
Snowflake + Power BI: Cloud Analytics for EveryoneAngel Abundez
 
Iceberg + Alluxio for Fast Data Analytics
Iceberg + Alluxio for Fast Data AnalyticsIceberg + Alluxio for Fast Data Analytics
Iceberg + Alluxio for Fast Data AnalyticsAlluxio, Inc.
 

What's hot (20)

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
 
Snowflake Data Science and AI/ML at Scale
Snowflake Data Science and AI/ML at ScaleSnowflake Data Science and AI/ML at Scale
Snowflake Data Science and AI/ML at Scale
 
Snowflake Overview
Snowflake OverviewSnowflake Overview
Snowflake Overview
 
Introduction to snowflake
Introduction to snowflakeIntroduction to snowflake
Introduction to snowflake
 
Intro to Delta Lake
Intro to Delta LakeIntro to Delta Lake
Intro to Delta Lake
 
Snowflake: The Good, the Bad, and the Ugly
Snowflake: The Good, the Bad, and the UglySnowflake: The Good, the Bad, and the Ugly
Snowflake: The Good, the Bad, and the Ugly
 
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
 
Demystifying Data Warehouse as a Service
Demystifying Data Warehouse as a ServiceDemystifying Data Warehouse as a Service
Demystifying Data Warehouse as a Service
 
Snowflake Company Presentation
Snowflake Company PresentationSnowflake Company Presentation
Snowflake Company Presentation
 
Data Sharing with Snowflake
Data Sharing with SnowflakeData Sharing with Snowflake
Data Sharing with Snowflake
 
Introducing the Snowflake Computing Cloud Data Warehouse
Introducing the Snowflake Computing Cloud Data WarehouseIntroducing the Snowflake Computing Cloud Data Warehouse
Introducing the Snowflake Computing Cloud Data Warehouse
 
Changing the game with cloud dw
Changing the game with cloud dwChanging the game with cloud dw
Changing the game with cloud dw
 
Snowflake Datawarehouse Architecturing
Snowflake Datawarehouse ArchitecturingSnowflake Datawarehouse Architecturing
Snowflake Datawarehouse Architecturing
 
Apache Iceberg - A Table Format for Hige Analytic Datasets
Apache Iceberg - A Table Format for Hige Analytic DatasetsApache Iceberg - A Table Format for Hige Analytic Datasets
Apache Iceberg - A Table Format for Hige Analytic Datasets
 
25 snowflake
25 snowflake25 snowflake
25 snowflake
 
Delta Lake OSS: Create reliable and performant Data Lake by Quentin Ambard
Delta Lake OSS: Create reliable and performant Data Lake by Quentin AmbardDelta Lake OSS: Create reliable and performant Data Lake by Quentin Ambard
Delta Lake OSS: Create reliable and performant Data Lake by Quentin Ambard
 
Data Mesh
Data MeshData Mesh
Data Mesh
 
Making Data Timelier and More Reliable with Lakehouse Technology
Making Data Timelier and More Reliable with Lakehouse TechnologyMaking Data Timelier and More Reliable with Lakehouse Technology
Making Data Timelier and More Reliable with Lakehouse Technology
 
Snowflake + Power BI: Cloud Analytics for Everyone
Snowflake + Power BI: Cloud Analytics for EveryoneSnowflake + Power BI: Cloud Analytics for Everyone
Snowflake + Power BI: Cloud Analytics for Everyone
 
Iceberg + Alluxio for Fast Data Analytics
Iceberg + Alluxio for Fast Data AnalyticsIceberg + Alluxio for Fast Data Analytics
Iceberg + Alluxio for Fast Data Analytics
 

Similar to Snowflake Data Loading.pptx

An overview of snowflake
An overview of snowflakeAn overview of snowflake
An overview of snowflakeSivakumar Ramar
 
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
 

Similar to Snowflake Data Loading.pptx (20)

An overview of snowflake
An overview of snowflakeAn overview of snowflake
An overview of snowflake
 
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
 

Recently uploaded

BabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxBabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxolyaivanovalion
 
定制英国白金汉大学毕业证(UCB毕业证书) 成绩单原版一比一
定制英国白金汉大学毕业证(UCB毕业证书)																			成绩单原版一比一定制英国白金汉大学毕业证(UCB毕业证书)																			成绩单原版一比一
定制英国白金汉大学毕业证(UCB毕业证书) 成绩单原版一比一ffjhghh
 
BigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxBigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxolyaivanovalion
 
Generative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusGenerative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusTimothy Spann
 
Industrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfIndustrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfLars Albertsson
 
100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptxAnupama Kate
 
Ukraine War presentation: KNOW THE BASICS
Ukraine War presentation: KNOW THE BASICSUkraine War presentation: KNOW THE BASICS
Ukraine War presentation: KNOW THE BASICSAishani27
 
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfMarket Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfRachmat Ramadhan H
 
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service BhilaiLow Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service BhilaiSuhani Kapoor
 
Mature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxMature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxolyaivanovalion
 
April 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's AnalysisApril 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's Analysismanisha194592
 
04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationshipsccctableauusergroup
 
VidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxVidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxolyaivanovalion
 
Carero dropshipping via API with DroFx.pptx
Carero dropshipping via API with DroFx.pptxCarero dropshipping via API with DroFx.pptx
Carero dropshipping via API with DroFx.pptxolyaivanovalion
 
Log Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptxLog Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptxJohnnyPlasten
 
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service AmravatiVIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service AmravatiSuhani Kapoor
 
Call Girls In Mahipalpur O9654467111 Escorts Service
Call Girls In Mahipalpur O9654467111  Escorts ServiceCall Girls In Mahipalpur O9654467111  Escorts Service
Call Girls In Mahipalpur O9654467111 Escorts ServiceSapana Sha
 
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /WhatsappsBeautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsappssapnasaifi408
 

Recently uploaded (20)

BabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxBabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptx
 
定制英国白金汉大学毕业证(UCB毕业证书) 成绩单原版一比一
定制英国白金汉大学毕业证(UCB毕业证书)																			成绩单原版一比一定制英国白金汉大学毕业证(UCB毕业证书)																			成绩单原版一比一
定制英国白金汉大学毕业证(UCB毕业证书) 成绩单原版一比一
 
BigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxBigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptx
 
Generative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusGenerative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and Milvus
 
Industrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfIndustrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdf
 
100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx
 
E-Commerce Order PredictionShraddha Kamble.pptx
E-Commerce Order PredictionShraddha Kamble.pptxE-Commerce Order PredictionShraddha Kamble.pptx
E-Commerce Order PredictionShraddha Kamble.pptx
 
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in Kishangarh
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in  KishangarhDelhi 99530 vip 56974 Genuine Escort Service Call Girls in  Kishangarh
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in Kishangarh
 
Ukraine War presentation: KNOW THE BASICS
Ukraine War presentation: KNOW THE BASICSUkraine War presentation: KNOW THE BASICS
Ukraine War presentation: KNOW THE BASICS
 
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfMarket Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
 
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service BhilaiLow Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
 
Mature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxMature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptx
 
April 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's AnalysisApril 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's Analysis
 
04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships
 
VidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxVidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptx
 
Carero dropshipping via API with DroFx.pptx
Carero dropshipping via API with DroFx.pptxCarero dropshipping via API with DroFx.pptx
Carero dropshipping via API with DroFx.pptx
 
Log Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptxLog Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptx
 
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service AmravatiVIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
 
Call Girls In Mahipalpur O9654467111 Escorts Service
Call Girls In Mahipalpur O9654467111  Escorts ServiceCall Girls In Mahipalpur O9654467111  Escorts Service
Call Girls In Mahipalpur O9654467111 Escorts Service
 
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /WhatsappsBeautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsapps
 

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