cortana intelligence - How to: Self join Stream Analytics? -


im trying replace null values last 10 seconds average in stream analytics job. requires self join between stream , averages calculate in clause. giving me duplicates(i same record twice or thrice)? suggestions on whats wrong or how properly? query is:

with mv ( select avg([sensor_1]) [sensor_1] [input] group slidingwindow(second, 10)) select [input].[id] ,[input].[timestamp] ,[input].[result] ,case      when [input].[sensor_1] = 0      [mv].[sensor_1] else [input].[sensor_1]      end [sensor_1] ,[input].[sensor_2] ,[input].[sensor_3] [input] left outer join [mv] on datediff(second, [input], [mv]) between 0 , 10 

sorry delay in responding on this.

the simplest solution change on datediff(second, [input], [mv]) between 0 , 10 on datediff(millisecond, [input], [mv]) = 0.

this because timestamps given in mv step of last event went slidingwindow , match timestamp on event in input (note: smaller time unit better match if using in-browser-testing-experience millisecond smallest supported unit).

do note while here can remove duplicates removing needless matches in join, in general stream analytics has no mechanism remove duplicates via distinct or that.

ziv.


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -