I have a need to be able to query Azure Data Explorer (ADX) tables dynamically, that is, using application-specific metadata that is also stored in ADX.
If this is even possible, the way to do it seems to be via the table() function. In other words, it feels like I should be able to simply write:
let table_name = <non-trivial ADX query that returns the name of a table as a string>;
table(table_name) | limit 10
But this query fails since I am trying to pass a variable to the table() function, and "a parameter, which is not scalar constant string can't be passed as parameter to table() function". The workaround provided doesn't really help, since all the possible table names are not known ahead of time.
Is there any way to do this all within ADX (i.e. without multiple queries from the client) or do I need to go back to the drawing board?
non-trivial ADX query...; 2) what is the number of distinct table names thatnon-trivial ADX query...may return?let LabelTable = datatable(table_name:string, label:string, updated:datetime) [ "TableA", "MyLabel", "2019-10-08", "TableB", "MyLabel", "2019-10-02" ]; let GetLabeledTable = (l:string) { toscalar( LabelTable | where label == l | order by updated desc | limit 1 ); }; let table_name = GetLabeledTable('MyLabel'); table(table_name) | limit 10