Flatten Nested JSON Array in Stream Analytics

Tran, Hoa 26 Reputation points
2022-03-31T20:38:36.1+00:00

Input data is streaming every 6s - the json array is below

{
"value": "{\"vrms\":0,\"apeak\":-102.4}",
"EventProcessedUtcTime": "2022-03-28T16:37:59.6289183Z",
"PartitionId": 0,
"EventEnqueuedUtcTime": "2022-03-28T15:37:58.0930000Z",
"IoTHub": {
"MessageId": "MSG_ID",
"CorrelationId": "CORE_ID",
"ConnectionDeviceId": "RUT955",
"ConnectionDeviceGenerationId": "637829563755785214",
"EnqueuedTime": "2022-03-28T15:37:58.0000000Z"
}

I'm trying to access the vrms and apeak value in the input data. I'm using the query below:

SELECT
UDF.parseJson(value).vrms,
UDF.parseJson(value).apeak
INTO
Output
From
Input

However, I keep getting the error
StepSplitter should never put Updatable UDFs and ML callouts in the same step! Step name powerbivisuoutputs0

My parseJson function is

function main(x) {
return JSON.parse(x);
}

Azure Stream Analytics
Azure Stream Analytics
An Azure real-time analytics service designed for mission-critical workloads.
365 questions
{count} vote

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.