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

WindowFunctionFrame

WindowFunctionFrame

WindowFunctionFrame is a contract for…​FIXME

Table 1. WindowFunctionFrame’s Implementations
Name Description

OffsetWindowFunctionFrame

SlidingWindowFunctionFrame

UnboundedFollowingWindowFunctionFrame

UnboundedPrecedingWindowFunctionFrame

UnboundedWindowFunctionFrame

UnboundedWindowFunctionFrame

UnboundedWindowFunctionFrame is a WindowFunctionFrame that gives the same value for every row in a partition.

UnboundedWindowFunctionFrame is created for AggregateFunctions (in AggregateExpressions) or AggregateWindowFunctions with no frame defined (i.e. no rowsBetween or rangeBetween) that boils down to using the entire partition frame.

UnboundedWindowFunctionFrame takes the following when created:

prepare Method

prepare requests AggregateProcessor to initialize passing in the number of UnsafeRows in the input ExternalAppendOnlyUnsafeRowArray.

prepare then requests ExternalAppendOnlyUnsafeRowArray to generate an interator.

In the end, prepare requests AggregateProcessor to update passing in every UnsafeRow in the iterator one at a time.

write Method

write simply requests AggregateProcessor to evaluate the target InternalRow.

WindowFunctionFrame Contract

Note
WindowFunctionFrame is a private[window] contract.
Table 2. WindowFunctionFrame Contract
Method Description

prepare

Used exclusively when WindowExec operator fetches all UnsafeRows for a partition (passing in ExternalAppendOnlyUnsafeRowArray with all UnsafeRows).

write

Used exclusively when the Iterator[InternalRow] (from executing WindowExec) is requested a next row.

赞(0) 打赏
未经允许不得转载:spark技术分享 » WindowFunctionFrame
分享到: 更多 (0)

关注公众号:spark技术分享

联系我们联系我们

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

支付宝扫一扫打赏

微信扫一扫打赏