Skip to content

KeyValueGroupedDataset

KeyValueGroupedDataset is an interface for Typed Grouping to calculate aggregates over groups of objects in a typed Dataset.

Note

RelationalGroupedDataset is used for untyped Row-based aggregates.

Creating Instance

KeyValueGroupedDataset takes the following to be created:

KeyValueGroupedDataset is created for the following high-level operators:

flatMapGroupsWithState

flatMapGroupsWithState[S: Encoder, U: Encoder](
  outputMode: OutputMode,
  timeoutConf: GroupStateTimeout)(
  func: (K, Iterator[V], GroupState[S]) => Iterator[U]): Dataset[U]
flatMapGroupsWithState[S: Encoder, U: Encoder](
  outputMode: OutputMode,
  timeoutConf: GroupStateTimeout,
  initialState: KeyValueGroupedDataset[K, S])(
  func: (K, Iterator[V], GroupState[S]) => Iterator[U]): Dataset[U]

flatMapGroupsWithState creates a Dataset with a FlatMapGroupsWithState logical operator (with the isMapGroupsWithState disabled).

flatMapGroupsWithState accepts Append and Update output modes only, and throws an IllegalArgumentException for the others:

The output mode of function should be append or update