snowflake

My Note

  • Creating basic csv file format
sql
create or replace file format basic_csv
type = 'CSV'
field_delimiter = ','
skip_header = 1
null_if = ('NULL', 'null', 'NA', 'N/A', '?', 'na')
field_optionally_enclosed_by = '"'
empty_field_as_null = true;
  • Create stage
sql
create or replace stage basic_stage
file_format = basic_csv
url = 's3://bucket-name/';
  • Copying into table
sql
copy into schema.table_name
from @basic_stage/bucket-name/directory/
pattern = '*.csv';