Working with file formats
File Formats :
we can create it using web UI (Options will be changing based of the file type you choose)
It is a named database object that can be used to simplify process of accessing the staged data and streamlines loading data into and unload data out of database tables.
A Snowflake file format encapsulates information of data files, such as file type(CSV, Json, etc..) and formatting options specific to each type used for bulk loading / unloading.
We can create it using SQL or using snowflake web-UI under database objects.
File formats supported by Snowflake :
- CSV
- JSON
- AVRO
- ORC
- PARQUET
- XML
File formats supported for both loading data and unloading data out of Databases :
- CSV
- JSON
- PARQUET
File Formats supported for only loading :
- AVRO,
- ORE
- XML
Note : File format options keep changing based on the type of file you work with so reffer documents ion always
Sample file Format with CSV :TYPE = 'CSV'
COMPRESSION = 'AUTO'
FIELD_DELIMITER = ','
RECORD_DELIMITER = '\n'
SKIP_HEADER = 1
FIELD_OPTIONALLY_ENCLOSED_BY = '"'
TRIM_SPACE = FALSE
ERROR_ON_COLUMN_COUNT_MISMATCH = TRUE
ESCAPE = 'NONE'
ESCAPE_UNENCLOSED_FIELD = '\134';
Comments
Post a Comment