问题
How do we generate a separate file for every record, containing a unique name?
I would like every row in my dataset to have a unique identifier, a guid preferably, but it could be anything:
@file =
EXTRACT col1 string,
col2 string,
col3 string
FROM @file1
USING Extractors.Csv(silent : true);
@output =
SELECT *, Guid.NewGuid().ToString() AS [myId]
FROM @file;
I would then create a separate file for each record:
OUTPUT @output
TO "/myFirstFunction_{myId}.txt"
USING Outputters.Tsv();
The files would be something like:
myFirstFunction_ba07d61d-a748-4344-bf70-da0012bd28bc.txt
myFirstFunction_36d9c255-eb0b-418d-adfe-a8bf2648ae57.txt
myFirstFunction_7858b8fc-7920-4918-bfcc-6b308d141d57.txt
myFirstFunction_9501ad01-73b8-43cb-be09-3bed4ebc8b7c.txt
myFirstFunction_59e10991-b431-4fb2-a165-5c9467f08ddd.txt
..
How do we generate a separate file for every record, containing a unique name?
来源:https://stackoverflow.com/questions/57977315/how-do-we-generate-a-random-id-for-each-record