How to get count of files from a folder(directory) in u-sql
if the folder has more than one file then process only the latest file else process first file !!
How to get count of files from a folder(directory) in u-sql
if the folder has more than one file then process only the latest file else process first file !!
As I said in comments you can do something like this:
DECLARE EXTERNAL @input string = @"/someFolder/{file}.csv";
@extractedData = EXTRACT file as string,
col1 as number,
col2 as string
FROM @input
USING new Extractors.Csv();
So whit this you will extract all files in folder and use it, even if it is one file or multiple. You need to guarantee that the files have same structure or your extractor will throw an error like
"expected 3 columns but got "x" columns...
After that you can work on your files data.