2

I am trying to set up a ASA job. My use case is that, I receive telemetry data from vehicles in the field. They transmit various attributes of the vehicle. e.g. Engine currently on or off

enter image description here

This data goes to IoT Hub and then ASA consumes it.

My problem is with the inputs coming out of sequence. For example, in the above diagram #9 came before #8.

He is my ASA Query

With AllSpeeder AS {
SELECT
    telemetry.deviceId as vehicleid,
    telemetry.enginestatus as currentenginestatus,
    telemetry.datetime as currenttime,
    Last(telemetry.containerdt) over (partition by telemetry.vehicleid limit duration(day,7) 
          when (telemetry.enginestatus = 'On2Off')) as engineontime
FROM
    theiot
Timestamp by cast ( telemetry.containerdt as datetime)
where
    telemetry.enginestatus = 'Off' or telemetry.enginestatus = 'On2Off' 
}

 SELECT * INTO theblob FROM AllSpeeder 

But the above query (TimeStamp by) did not fix it.

I experimented with Event Order in ASA But still 8 and 9 above are not getting reordered. enter image description here

Mnaseem
  • 145
  • 1
  • 7
  • Konstantin Zoryn reply in https://social.msdn.microsoft.com/Forums/en-US/17e4fa7d-3ba2-4fec-b558-aaddf5381c44/azure-stream-analytics-amp-event-ordering?forum=AzureStreamAnalytics got me back in right path. Now it is reordering. I have asked him to answer this question here. So i can mark that as answer. – Mnaseem Oct 22 '18 at 04:50

0 Answers0