0

I am trying to get aggregate data sent to different table storage outputs based on a column name in select query. I am not sure if this is possible with stream analytics. I've looked up the stream analytics docs and different forums, so far haven't found any leads. I am looking for something like

Select tableName,count(distinct records) into tableName from inputStream

I hope this makes it clear what I'm trying to achieve, I am trying to insert aggregates data into table storage (defined as outputs). I want to grab the output stream/tablestorage name from a select Query. Any idea how that could be done?

Shahab Uddin
  • 101
  • 1
  • 11
  • can this help in your case? https://stackoverflow.com/questions/45059617/azure-stream-analytics-how-to-handle-multiple-output-table – gusgonnet May 13 '21 at 02:34

1 Answers1

0

I am trying to get aggregate data sent to different table storage outputs based on a column name in select query.

If i don't misunderstand your requirement,you want to do a case...when... or if...else... structure in the ASA sql so that you could send data into different table output based on some conditions. If so,i'm afraid that it could not be implemented so far.Every destination in ASA has to be specific,dynamic output is not supported in ASA.

However,as a workaround,you could use Azure Function as output.You could pass the columns into Azure Function,then do the switches with code in the Azure Function to save data into different table storage destinations. More details,please refer to this official doc:https://learn.microsoft.com/en-us/azure/stream-analytics/stream-analytics-with-azure-functions

Jay Gong
  • 23,163
  • 2
  • 27
  • 32
  • Yes, you got it. Here's whats going on. I want to create aggregates for multiple customers and there warehouses and employees. So the device sends telemetry data to an iothub on the builtin endpoint which is used as an input sink in stream analytics. The stream job gets joins the telemetry message with a reference input(based on device id in the metadata property of telemetry message), and now aggregates are created and to be sent to different tables(for different customers). I've done the reference input part and the aggregates part its putting then in different tables thats not achieved – Shahab Uddin Jan 29 '20 at 07:23