Skip to content

Instantly share code, notes, and snippets.

@nordineb
Last active May 15, 2022 07:47
Show Gist options
  • Save nordineb/44f554524b3f90e981c65b2fe8001a64 to your computer and use it in GitHub Desktop.
Save nordineb/44f554524b3f90e981c65b2fe8001a64 to your computer and use it in GitHub Desktop.
subselect
DECLARE @inputfile string = "/Data/Meny/postgres_public_customer.csv";
DECLARE @cvsout string = "/Data/Meny/Output/ourcustomers2.csv";
DECLARE @tsvout string = "/Data/Meny/Output/ourcustomers2.tsv";
DECLARE @txtout string = "/Data/Meny/Output/ourcustomers2.txt";
@customers =
EXTRACT UserId int,
FirstName string,
LastName string,
Address string,
Phone string
FROM @inputfile
USING Extractors.Csv();
@namedataset =
SELECT FirstName, LastName
FROM @customers;
OUTPUT @namedataset
TO @cvsout
USING Outputters.Csv();
OUTPUT @namedataset
TO @tsvout
USING Outputters.Tsv();
// try to output to @tvsout to demonstrate an error
OUTPUT @namedataset
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