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

flatMapGroupsWithState Operator — Arbitrary Stateful Streaming Aggregation (with Explicit State Logic)

flatMapGroupsWithState Operator — Arbitrary Stateful Streaming Aggregation (with Explicit State Logic)

Note
flatMapGroupsWithState requires Append or Update output modes.
Note
Every time the state function func is executed for a key, the state (as GroupState[S]) is for this key only.
Caution
FIXME Why can’t flatMapGroupsWithState work with Complete output mode?
Note
  • K is the type of the keys in KeyValueGroupedDataset

  • V is the type of the values (per key) in KeyValueGroupedDataset

  • S is the user-defined type of the state as maintained for each group

  • U is the type of rows in the result Dataset

Internally, flatMapGroupsWithState operator creates a Dataset with FlatMapGroupsWithState unary logical operator.

flatMapGroupsWithState reports a IllegalArgumentException when the input outputMode is neither Append nor Update.

Caution
FIXME Examples for append and update output modes (to demo the difference)
Caution
FIXME Examples for GroupStateTimeout.EventTimeTimeout with withWatermark operator
赞(0) 打赏
未经允许不得转载:spark技术分享 » flatMapGroupsWithState Operator — Arbitrary Stateful Streaming Aggregation (with Explicit State Logic)
分享到: 更多 (0)

关注公众号:spark技术分享

联系我们联系我们

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

支付宝扫一扫打赏

微信扫一扫打赏