WindowSpec defines a window specification for Window Functions.
WindowSpec takes the following to be created:
WindowSpec is created when:
Windowutility is used to create a default WindowSpec
WindowSpecis requested to partitionBy, orderBy, rowsBetween, rangeBetween
Partition specification are Expressions that define which rows are in the same partition. With no partition defined, all rows belong to a single partition.
Order specification are SortOrders that define how rows are ordered in a partition that in turn defines the position of a row in a partition.
The ordering could be ascending (
ASC in SQL or
asc in Scala) or descending (
Frame specification is a
WindowFrame that defines the rows to include in the frame for the current row, based on their relative position to the current row.
For example, "the three rows preceding the current row to the current row" describes a frame including the current input row and three rows appearing before the current row.
Window utility defines special Frame Boundaries.
rowsBetween( start: Long, end: Long): WindowSpec
rangeBetween( start: Long, end: Long): WindowSpec