Skip to content

Instantly share code, notes, and snippets.

@nordineb
Last active May 15, 2022 07:46
Show Gist options
  • Save nordineb/623102855e06d7af55b817da0b5f68af to your computer and use it in GitHub Desktop.
Save nordineb/623102855e06d7af55b817da0b5f68af to your computer and use it in GitHub Desktop.
simple select demo
DECLARE @inputfile string = "/Data/Meny/postgres_public_customer.csv";
DECLARE @cvsout string = "/Data/Meny/Output/ourcustomers.csv";
DECLARE @tsvout string = "/Data/Meny/Output/ourcustomers.tsv";
DECLARE @txtout string = "/Data/Meny/Output/ourcustomers.txt";
@customers =
EXTRACT UserId int,
FirstName string,
LastName string,
Address string,
Phone string
FROM @inputfile
USING Extractors.Csv();
OUTPUT @customers
TO @cvsout
USING Outputters.Csv();
OUTPUT @customers
TO @tsvout
USING Outputters.Tsv();
// try to output to @tvsout to demonstrate an error
OUTPUT @customers
TO @txtout
USING Outputters.Text(delimiter: '|',quoting: false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment