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

CumeDist

CumeDist Declarative Window Aggregate Function Expression

CumeDist is a SizeBasedWindowFunction and a RowNumberLike expression that is used for the following:

CumeDist takes no input parameters when created.

CumeDist uses cume_dist for the user-facing name.

As an WindowFunction expression (indirectly), CumeDist requires the SpecifiedWindowFrame (with the RangeFrame frame type, the UnboundedPreceding lower and the CurrentRow upper frame boundaries) as the frame.

Note
The frame for CumeDist expression is range-based instead of row-based, because it has to return the same value for tie values in a window (equal values per ORDER BY specification).

As a DeclarativeAggregate expression (indirectly), CumeDist defines the evaluateExpression expression which returns the final value when CumeDist is evaluated. The value uses the formula rowNumber / n where rowNumber is the row number in a window frame (the number of values before and including the current row) divided by the number of rows in the window frame.

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

关注公众号:spark技术分享

联系我们联系我们

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

支付宝扫一扫打赏

微信扫一扫打赏