Skip to content

Instantly share code, notes, and snippets.

@adammarples
Created June 4, 2019 08:28
Show Gist options
  • Save adammarples/439f1ce55768ff5bf1870a0cb4572a13 to your computer and use it in GitHub Desktop.
Save adammarples/439f1ce55768ff5bf1870a0cb4572a13 to your computer and use it in GitHub Desktop.
create or replace file format example_file_format_name
type = 'csv'
field_delimiter = ','
skip_header = 1
date_format = 'DD/MM/YYYY';
create or replace stage example_stage_name
file_format = example_file_format_name;
////example.csv
//auto,euro
//03/12/2019,12/03/2019
//05/27/2019,27/05/2019
push example.csv @example_stage_name
select $1 auto, $2 euro from @example_stage_name/example.csv.gz
select $1::date auto, $2 euro from @example_stage_name/example.csv.gz
select $1 auto, $2::date euro from @example_stage_name/example.csv.gz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment