how can we have dynamic output file name in u-sql

2019-05-26 22:07发布

问题:

how can we have dynamic output file name in u-sql in azure data lake based on timestamp when job is executed.Thanks for help.My code as below:

 OUTPUT @telDataResult
    TO 
    @"wasb://blobcontainer@blobstorage.blob.core.windows.net/**yyyymmdd**_TelDataOutput.Csv"

    USING Outputters.Csv(); 

回答1:

This feature is currently in development but not available yet. Feel free to add your vote to the feature request: https://feedback.azure.com/forums/327234-data-lake/suggestions/10550388-support-dynamic-output-file-names-in-adla

Once it becomes available, you would do the inverse of the fileset syntax on EXTRACT. Let's assume you have a column that is called eventdate in your rowset @res. Then the following OUTPUT statement would generate the files:

OUTPUT @res
TO "/{eventdate:yyyy}/{eventdate:MM}/{eventdate:dd}/result.csv"
USING Outputters.Csv();