关注 spark技术分享,
撸spark源码 玩spark最佳实践

Window Utility Object — Defining Window Specification

Window Utility Object — Defining Window Specification

Window utility object is a set of static methods to define a window specification.

Table 1. Window API
Method Description

currentRow

Value representing the current row that is used to define frame boundaries.

orderBy

Creates a WindowSpec with the ordering defined.

partitionBy

Creates a WindowSpec with the partitioning defined.

rangeBetween

Creates a WindowSpec with the frame boundaries defined, from start (inclusive) to end (inclusive). Both start and end are relative to the current row based on the actual value of the ORDER BY expression(s).

rowsBetween

Creates a WindowSpec with the frame boundaries defined, from start (inclusive) to end (inclusive). Both start and end are positions relative to the current row based on the position of the row within the partition.

unboundedFollowing

Value representing the last row in a partition (equivalent to “UNBOUNDED FOLLOWING” in SQL) that is used to define frame boundaries.

unboundedPreceding

Value representing the first row in a partition (equivalent to “UNBOUNDED PRECEDING” in SQL) that is used to define frame boundaries.

Creating “Empty” WindowSpec — spec Internal Method

spec creates an “empty” WindowSpec, i.e. with empty partition and ordering specifications, and a UnspecifiedFrame.

Note

spec is used when:

赞(0) 打赏
未经允许不得转载:spark技术分享 » Window Utility Object — Defining Window Specification
分享到: 更多 (0)

关注公众号:spark技术分享

联系我们联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏