Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How dynamically create multiple output files from 1 or more input files? #129

Open
almusawi opened this issue Apr 16, 2018 · 2 comments
Open

Comments

@almusawi
Copy link

is it possible to create dynamically output files depend on the date?
For example:

DECLARE @output_Path string = @"/Folder/_{_Date:yyyy}{_Date:MM}out.tsv";
@ex =
EXTRACT
ID int,
EventTime string
FROM @in
USING Extractors.text()

@res =
SELECT ID,
DateTime.Parse(EventTime) AS _Date
FROM @ex

OUTPUT @res
TO @output_Path
USING Outputters.csv()

@MikeRys
Copy link
Collaborator

MikeRys commented Apr 16, 2018

Yes... although this feature is in Private Preview at the moment. Can you send me an email to usql at microsoft dot com with a description of your scenario? I can give you the explanation on how to enable the private preview capability for it.

@RamPatel58
Copy link

I have a same scenario. I have one input file I have to spilt that input file to multiple output based on column value.
Say Input file has column country,product,sales and I have to generated outputfile based on countryname.

country,product,sales
US,WIN10,12
US,O365,13
UK,Book,12
INDIA,mobile,14
based on the above input, I want 3 output file UK_produc.csv,US_product.csv and India_product.csv.

Could you please help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants