- All Known Implementing Classes:
WindowFrame.BoundedFrame,WindowFrame.CumulativeFrame,WindowFrame.PartitionFrame
public sealed interface WindowFrame
permits WindowFrame.BoundedFrame, WindowFrame.CumulativeFrame, WindowFrame.PartitionFrame
The scope of rows fed to a
WindowFunction within a partition.
A frame is the window operator's analogue of SQL's
ROWS BETWEEN … AND … clause. The sealed hierarchy has three permits,
each corresponding to one surface form (or the implicit full-partition frame
used by ranking and offset functions):
WindowFrame.BoundedFrame—OVER n ROWS: the current row plus the precedingn − 1rows (a trailingn-row sliding window).WindowFrame.CumulativeFrame—OVER ALL ROWS: the full prefix of the partition up to and including the current row (running total).WindowFrame.PartitionFrame— the whole partition; never written in the surface syntax, set implicitly for ranking and offset functions.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordA trailingn-row sliding window —OVER n ROWS— equivalent to SQL'sROWS BETWEEN n-1 PRECEDING AND CURRENT ROW.static final recordThe cumulative (running) frame —OVER ALL ROWS— equivalent to SQL'sROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW.static final recordThe full-partition frame used implicitly by ranking and offset functions — equivalent to SQL'sROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING.