I want to write same query for multiple files. Is this possible to write dynamic query in U-SQL or is there any way to eliminate re-writing of same piece of code like
Select count(*) as cnt from @table1;
Select count(*) as cnt from @table2;
can be replaced to
Select count(*) as cnt from @dynamic
where @dynamic = table1, table2
(Azure Data Lake team here)
Your question mentions reading from files, but your example shows tables. If you do really do want to read from files, the EXTRACT statement supports "File Sets" that allow a single EXTRACT statement to read multiple files that are specified by a pattern
Sometimes, the data needs to include the filename the data came frome, so you can specify it like this: