Time-based Window

A window defined by a rowtime interval. The window’s defining criteria specify a finite set of rows, using a rowtime-based specification.

At any arbitrary wall-clock-time, the number of rows to be found in that window can vary, based on the number of rows that have arrived whose rowtimes are within the window’s defined period. (The SQL standard calls this a “logical” window, and calls a Row-based Window a “physical” window.)

For example, RANGE INTERVAL ‘1’ HOUR PRECEDING specifies that the window contains all rows whose ROWTIMEs are within the hour preceding the stream’s current time. (That time is usually the rowtime of the most recent row received.)

In many cases, you may want to time-sort windows. For more information on time-sorting stream input, see the subtopic T-sorting Stream Input in the topic ORDER BY clause