I want to output a single table into multiple files in U-SQL according to the number of rows.
If my table is having 500 rows, then I have to generate 5 files or 100 rows in each file.
Followed the post, U-SQL Output in Azure Data Lake
I want to output a single table into multiple files in U-SQL according to the number of rows.
If my table is having 500 rows, then I have to generate 5 files or 100 rows in each file.
Followed the post, U-SQL Output in Azure Data Lake
In order to generate separate files based on number of rows, you would have to add a ROW_NUMBER()
to each row. Then generate a script (for example with U-SQL, see U-SQL Output in Azure Data Lake as an example) that creates an output statement for each of the row regions. Note the script generation file probably uses an inner join with a SELECT COUNT(*) FROM @data
to generate the right number of OUTPUT
statements. Also you want the first statement in the generated script to be the one that adds the ROW_NUMBER()
to the rowset that you then output.
Once you generated the script that does that, you can then download it and submit it.