Skip to content

[FLINK-40180] Non-keyed/operator state support in State Catalog - #29216

Open
gyfora wants to merge 3 commits into
apache:masterfrom
gyfora:statecatalog-upstream
Open

gyfora wants to merge 3 commits into
apache:masterfrom
gyfora:statecatalog-upstream

Conversation

@gyfora

@gyfora gyfora commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

What is the purpose of the change

The state catalog (introduced in FLINK-40176) lets you query savepoint/checkpoint state via SQL, but so far only covered keyed state. This PR extends it to non-keyed (operator) state — ListState, UnionState, and BroadcastState — exposing each as its own table.

Brief change log

  • Extract non-keyed state schema info (value/key type, LIST vs UNION vs BROADCAST) from the operator state serialization proxy, tolerating missing POJO classes the same way keyed state does
  • Build CatalogTables for ListState/UnionState (one row per element) and BroadcastState (one row per map entry, keyed on map_key)
  • Wire the new table kinds into StateCatalog (naming/listing) and SavepointDynamicTableSourceFactory (scan)
  • Add integration tests reading back list/union/broadcast state, including POJO value types with the class missing from the classpath

Verifying this change

This change added tests and can be verified as follows:

  • Added StateCatalogNonKeyedITCase (run against both HashMap and RocksDB state backends), covering all three state shapes and the missing-POJO-class fallback path

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): no
  • The public API, i.e., is any changed class annotated with @Public(Evolving): yes (StateCatalog, still @PublicEvolving)
  • The serializers: no
  • The runtime per-record code paths (performance sensitive): no
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: no
  • The S3 file system connector: no

Documentation

  • Does this pull request introduce a new feature? yes
  • If yes, how is the feature documented? JavaDocs

Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

Generated-by: Claude Code (Sonnet 5)

…tilities

Adds the schema-extraction and catalog-table-building utilities needed
to expose an operator's non-keyed state (ListState/UnionState/
BroadcastState): NonKeyedStateSchemaInfo and OperatorStateSchemaInfo,
plus hasNonInternalOperatorState, getNonKeyedStateSchema,
getOperatorStateCatalogTable, and getBroadcastStateCatalogTable in
StateTableUtils, mirroring the keyed/window state utilities added
previously. Also extends getOperatorIdentifiers to include operators
that register only non-keyed state.

These are not yet wired into the catalog or table factory.
…g and factories

Wires the non-keyed (ListState/UnionState/BroadcastState) utilities
added previously into the catalog and table factory:

- StateCatalog: adds the LIST/UNION/BROADCAST table suffixes and
  getTable() dispatch, and extends candidateTablesForOperator to
  enumerate one table per non-keyed state (an operator may register
  only non-keyed state, with no plain per-key "_keyed" table).
- SavepointDynamicTableSourceFactory: adds the LIST/UNION/BROADCAST
  dispatch and createOperatorStateDynamicTableSource/
  createBroadcastStateDynamicTableSource, mirroring the keyed/window
  table source creation.
- Adds the DynamicTableSource/ScanProvider/TableMapping
  implementations for operator (list/union) and broadcast state:
  AbstractNonKeyedDynamicTableSource, AbstractNonKeyedDataStreamScanProvider,
  OperatorStateDynamicTableSource, OperatorStateDataStreamScanProvider,
  OperatorStateTableMapping, BroadcastStateDynamicTableSource,
  BroadcastStateDataStreamScanProvider, BroadcastStateTableMapping.
Adds StateCatalogNonKeyedITCase covering read access to operator
ListState/UnionState/BroadcastState through the StateCatalog.
@flinkbot

flinkbot commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants