Skip to content


StateManagerImplV2 is a concrete StateManager (as a StateManagerImplBase) that is used by default in FlatMapGroupsWithStateExec physical operator (per spark.sql.streaming.flatMapGroupsWithState.stateFormatVersion internal configuration property).

Creating Instance

StateManagerImplV2 takes the following to be created:

  • [[stateEncoder]] State encoder (ExpressionEncoder[Any])
  • [[shouldStoreTimestamp]] shouldStoreTimestamp flag

StateManagerImplV2 is created when:

  • FlatMapGroupsWithStateExecHelper utility is requested for a StateManager (when the stateFormatVersion is 2)