azure data lake - Dynamic FROM in U-SQL statement -
i trying generate dynamic clause in u-sql can extract data different files based on previous query outcome. that's this:
@filestoextract = select whatevergeneratesthepaths @foo; <-- query generates rowset file want extract like: [/path/file1.csv, /path/file2.csv] select * @filestoextract; <-- here want extract data file1 , file2
i'm afraid kind of dynamics queries not supported yet, can pointing me out way achieve this? seems feasible approach generate u-sql script , execute afterwards.
thanks in advance.
it not clear question if want file names dynamically retrieved , passed extract statement, or name of tables/rowsets , passed select's clause. or both.
in general, cannot dynamically generate source names u-sql expression. may want file feature request here http://aka.ms/adlfeedback dynamically or statically parameterizable sources.
having said that, depending on exact requirements, there may ways achieve goals without work-around describe.
for example, write code parameterized table-valued function , pass different rowsets different scripts, or - if statically can decide rowset choose - can use if statement.
here pseudo-code example:
declare external @someconditionparameter boolean = true; if (@someconditionparameter) @data = extract int, b string @fileset1 using extractors.csv(); else @data = extract int, b string @file2 using ...; end; @results = mytablevaluedfunction (@data); ...
if files schematized differently, may able use flexible column sets (currently in preview, see release notes) in tvf handle variability of rowset schema.
Comments
Post a Comment