IMPORTANT: Currently, WINDOW can only be used for element and time windows. For Predicate Windows use PREDICATEWINDOW instead.

 

The window sets – dependent on the used parameters – the validity of the tuple. If a time based window is used, the default time granularity is in milliseconds. So, if you have another time granularity, you may use the unit-parameter (e.g. use 5 for size and SECONDS for the unit parameter) or you have to adjust the arity (e.g. use 5000 for size without the unit parameter)

Parameter

Example

//sliding time window (notice: size and advance is directly based on the used timestamps. 
//if they are in milliseconds (which is default), size and advance are in milliseconds too.
 output = WINDOW({
                  size = 5, 
                  advance = 1, 
                  type = 'time'
                 }, input)

//sliding time window with another time unit for size. 
//size is converted from seconds into milliseconds (since this is the default time granularity). This means, size will be 5000 and advance will be 1
 output = WINDOW({
                  size = [5, 'SECONDS'], 
                  advance = 1, 
                  type = 'time'
				 }, input)

//sliding time window with another time unit for size and advance. 
//size
 and advance are converted from seconds into milliseconds (since this is
 the default time granularity). This means, size will be 5000 and 
advance will be 1000
 output = WINDOW({
                  size = [5, 'SECONDS'], 
                  advance = [1, 'SECONDS'], 
                  type = 'time',
                 }, input)

//sliding tuple window partitioned over bidder
 output = WINDOW({
                  size = 5, 
                  advance = 1, 
                  type = 'tuple', 
                  partition=['bidder']
                 }, input) 

 //now window (size = 1, advance = 1)
 output = WINDOW({
                  type = 'time'
                 }, input)

 //sliding delta window, reduces time granularity to value of slide
 output = WINDOW({
                  size = 5, 
                  type = 'time', 
                  slide = 5
                 }, input)

 // Predicate window
 output = WINDOW({
                  start = 'a > 10 and a < 20', 
				  type = 'Predicate'
				 }, input)
 output = WINDOW({
                  start = 'a = 11',
				  end = 'a = 20',
				  type = 'Predicate'
				 }, input)