need some advice comparing sliding window to a single unit

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

need some advice comparing sliding window to a single unit

avilevi
Hi,
I want to get the average of the last x hours and compare it to the sum of the current hour.
I thought of using ProcessWindowFunction for 8 hours and do the calculation i.e consuming 8 hours of data and group it by the hour and do the math, but it seems very inefficient especially considering that we are dealing with heavy load. 
is there any other more elegant solution ?
 
Cheers
Avi