You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

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

  • size: The size of the window
  • advance: The advance the window moves forward
  • slide: The slide of the window. When using this parameter all elements in the windows will have the same starttimestamp (e.g. helful for aggregations), while advance will not change the starttimestamp.
  • type: The type of the window. The possible values are Time, Tuple, Predicate, and Unbound
  • partition: The partition attribute of the window
  • start: The start condition for a predicate window. If the condition evaluates to true, the windows is opened until the end predicate evaluates to true (or if not given the start predicate evaluates to false). Note, that all elements that are not inside a window are send to ouput port 1
  • end: The end condition for a predicate window
  • sameStartTime: For predicate windows: If set to true, all produced elements get the same start timestamp
  • unit: The unit for the time granularity - Possible values are one of TimeUnit like SECONDS, NANOSECODS etc. - default time

Example

Window Operator
//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 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, 
                  advance = 1, 
                  type = 'time',
				  unit = 'SECONDS'
				 }, input)

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

 //unbounded window
 output = WINDOW({
                  type = 'unbounded'
                 }, 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)
  • No labels