0

I know stream analytics has several window funcitons. In my case I need to aggregate messages over a time window where a new window should start every time a field (or a combination of fields) change.

To make this concrete: suppose I have the following messages:

  1. temp: 50, pressure: 5, productType: vehicles, alarmX:0
  2. temp: 52, pressure: 4, productType: vehicles, alarmX:0
  3. temp: 54, pressure: 3, productType: vehicles, alarmX:0
  4. temp: 56, pressure: 2, productType: planes, alarmX:0
  5. temp: 58, pressure: 3, productType: planes, alarmX:0
  6. temp: 50, pressure: 5, productType: planes, alarmX:1
  7. temp: 50, pressure: 5, productType: planes, alarmX:1
  8. temp: 50, pressure: 5, productType: vehicles, alarmX:0
  9. temp: 48, pressure: 5, productType: vehicles, alarmX:0

I want to aggregate over a window defined by a change in productType and/or alarmX. So I want to aggregate over items (1,2,3) - (4,5) - (6,7) - (8,9)

How is this possible using stream analytics? Is there an alternative?

Jan Bols
  • 457
  • 4
  • 11

1 Answers1

0

Have you looked into session windows for this ? You'll need some sort of timestamp column as well .

Chetan
  • 101
  • 2
  • As mentioned window is defined in one way or another over a time slice. The only thing described is that change in productType and/or alarmX define different windows. To do just that it is enough to GROUP BY productType,alarmX . I assume the order of example events is "as the time progresses". So as you suggested you need to have a time column and define a window based on that. Maybe a sliding window with further filtering of the repeated results. – Chetan Feb 09 '21 at 17:16