Last active
May 15, 2022 07:47
-
-
Save nordineb/44f554524b3f90e981c65b2fe8001a64 to your computer and use it in GitHub Desktop.
subselect
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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