What would you like to happen?
The Spark Structured Streaming (Dataset-based) runner currently rejects any DoFn that uses state, uses timers, or is annotated with @RequiresTimeSortedInput. ParDoTranslatorBatch.canTranslate fails with "States and timers are not supported for the moment", so the entire state and timer surface of the Beam model is unavailable on this runner.
The classic RDD-based Spark runner supports batch stateful ParDo, so this is a capability gap between the two Spark runners rather than a limitation of Spark.
Proposal
Translate stateful / timer / time-sorted ParDo via KeyValueGroupedDataset#flatMapSortedGroups, grouping by key and ordering each group by event time, then drive the DoFn per key with InMemoryStateInternals and InMemoryTimerInternals from runners-core.
Because batch has no state store to bridge onto — state is a heap object scoped to one key — every Beam state type is already implemented by InMemoryStateInternals, so the state categories above can be enabled together rather than incrementally.
Additional (tagged) outputs for stateful ParDo should be in scope for this issue.
Issue Priority
Priority: 2 (default / most feature requests should be filed as P2)
Issue Components
What would you like to happen?
The Spark Structured Streaming (Dataset-based) runner currently rejects any
DoFnthat uses state, uses timers, or is annotated with@RequiresTimeSortedInput.ParDoTranslatorBatch.canTranslatefails with "States and timers are not supported for the moment", so the entire state and timer surface of the Beam model is unavailable on this runner.The classic RDD-based Spark runner supports batch stateful ParDo, so this is a capability gap between the two Spark runners rather than a limitation of Spark.
Proposal
Translate stateful / timer / time-sorted
ParDoviaKeyValueGroupedDataset#flatMapSortedGroups, grouping by key and ordering each group by event time, then drive theDoFnper key withInMemoryStateInternalsandInMemoryTimerInternalsfromrunners-core.Because batch has no state store to bridge onto — state is a heap object scoped to one key — every Beam state type is already implemented by
InMemoryStateInternals, so the state categories above can be enabled together rather than incrementally.Additional (tagged) outputs for stateful ParDo should be in scope for this issue.
Issue Priority
Priority: 2 (default / most feature requests should be filed as P2)
Issue Components