diff --git a/docs/content.zh/docs/libs/state_processor_api.md b/docs/content.zh/docs/libs/state_processor_api.md index cd9c73d6eb2786..50464c84537159 100644 --- a/docs/content.zh/docs/libs/state_processor_api.md +++ b/docs/content.zh/docs/libs/state_processor_api.md @@ -771,3 +771,167 @@ then it can be overridden with the two mentioned config parameters on a per-colu SHORTCUT: When a complex java class is defined in a column with STRING SQL type then the class instance `toString` method result will be the column value. This can be useful when a quick explanatory query is required. + +## State Catalog + +The `state` catalog is a read-only catalog that finds savepoints and checkpoints in one or more directories and exposes their state as tables. +Table schemas are inferred from the snapshot, so you don't need `CREATE TABLE` statements or the job's POJO or Avro classes on the classpath. + +The catalog is part of `flink-state-processor-api`. For the SQL Client, copy the jar from `opt/` to `lib/`. + +```sql +SET 'execution.runtime-mode' = 'batch'; +LOAD MODULE state; -- needed for the metadata view + +CREATE CATALOG state WITH ( + 'type' = 'state', + 'directory.my-app' = 's3://my-bucket/flink/my-app', + 'directory.staging' = '/savepoints/staging' +); +``` + +### Catalog Options + +| Option | Required | Default | Type | Description | +|-------------------------|----------|---------|---------|-------------| +| type | required | (none) | String | Must be `'state'`. | +| directory.<label> | required | (none) | String | A directory to search for savepoints and checkpoints, on any file system Flink supports. `