SNOWFLAKE  DATA LOADING

) How do I load my data into Snowflake? 

Limited data (Web Interface)

Bulk Data (SQL & SnowSQL)

Auto-INGEST(Snowpipe)

3rd Part ETL Tool


2) What types of data storage can Snowflake load from?

Supported file 

(1) Structured Data

    CSV

(1) Semi-Structured Data

    JSON

    Avro

    Parquet

    Orc

    XML




 3) What is a “stage” in Snowflake? 

There are two type of stage (1) Internal (2) External

Internal Stage area (local system)

(a) User Stage > Each user has a Snowflake stage allocated to them by default for storing files. This stage is a convenient option if your files will only be accessed by a single user, but need to be copied into multiple tables. 

Referenced:@~, Provided by default,Only access by user, Can't be alter or delete


(b) 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. 


(c) Name Stage > database object, the security/access rules that apply to all objects apply. The privileges to use a stage can be granted or revoked from roles. In addition, ownership of the stage can be transferred to another role. 

Creating a Named Stage


CREATE OR REPLACE STAGE my_stage

  file_format = (type = 'CSV' FIELD_DELIMITER = '|' SKIP_HEADER = 1);

Create File Format

CREATE FILE FORMAT NAME

TYPE = CSV

File Type Modifiers

FIELD_DELIMITER ='|'

SKIP_HEADER =2;

COPY INTO table_name

FROM stage_name

[FILES = ('<file_name>'[,'<file_name>'...])]

FILE_FORMAT = (FORMAT_NAME = <file_format_name>)



External Stage (On Premise Storage)

(a) AWS,GCP,AZURE

 Url access credentials 


4) Why would I choose one loading method over another? 

5) What are some best practices for data loading?