THE SQL Server Blog Spot on the Web

Welcome to SQLblog.com - The SQL Server blog spot on the web Sign in | Join | Help
in Search

The Bit Bucket (Greg Low): IDisposable

Ramblings of Greg Low (SQL Server MVP, MCM and Microsoft RD) - SQL Down Under

SQL Server 2008 R2: StreamInsight changes at RTM: HoppingWindow, TumblingWindow, SnapshotWindow

We've been working on updating our demos and samples for the RTM changes of StreamInsight. I'll detail these as I come across them.

The first is that there is a change to the HoppingWindow. The first two parameters are the same in the constructor but the third parameter is now required. It is the HoppingWindowOutputPolicy. Currently, there is only a single option for this which is ClipToWindowEnd.

A similar change happened to the TumblingWindow. Curiously, it also takes a HoppingWindowOutputPolicy. I suppose that makes sense though as it is really just a special case of a HoppingWindow.

SnapshotWindow also now has a required parameter but in this case it's a SnapshotWindowOutputPolicy. The option for this policy is just called Clip.

Here are some examples of creating HoppingWindow, TumblingWindow and SnapshotWindow.

var queryOutput = from w in input.HoppingWindow

                         (TimeSpan.FromMinutes(1),

                          TimeSpan.FromSeconds(10),

                          HoppingWindowOutputPolicy.ClipToWindowEnd)

                  select new { VehiclesPerMinute = w.Count() };

 

var queryOutput = from w in input.TumblingWindow

                     (TimeSpan.FromSeconds(10),

                      HoppingWindowOutputPolicy.ClipToWindowEnd)

                  select new { VehiclesPer10Seconds = w.Count() };

 

var queryOutput = from w in input.SnapshotWindow

                            (SnapshotWindowOutputPolicy.Clip)

                  select new { VehiclesPerWhat = w.Count() };

 

Published Friday, May 07, 2010 2:54 PM by Greg Low

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Leave a Comment

(required) 
(optional)
(required) 
Submit
Powered by Community Server (Commercial Edition), by Telligent Systems
  Privacy Statement