Hello Deepak Chaurasiya,
My understanding is that in Azure Stream Analytics, User-Defined Functions are designed to process each input record individually. So UDF will receive one record at a time, not a collection of records.
This is the reason you are seeing a single record in your UDF.
To process a collection of records within a window, you can use the aggregate function - collect()
collect() Returns an array with all record values from the window.
You can modify your query to collect the records into an array using the collect() and then pass array to your UDF.
Please modify your code below and see if it helps.
-- Define the input alias
WITH [AggregatedData] AS (
SELECT
System.Timestamp() AS WindowStart,
UDF.AggrFunction(collect(IotMessage)) AS Message
FROM
[IoTOutput] AS IotMessage
GROUP BY
TumblingWindow(second, 10),
IotMessage
)
-- Define the output alias
SELECT
[Message].*
INTO
[OEEIn]
FROM
[AggregatedData]
https://learn.microsoft.com/en-us/stream-analytics-query/collect-azure-stream-analytics