FangYongs commented on code in PR #23110:
URL: https://github.com/apache/flink/pull/23110#discussion_r1297400125


##########
docs/content/docs/dev/table/catalogs.md:
##########
@@ -807,3 +807,192 @@ the gateway, or you can also use `SET` to specify the 
listener for ddl, for exam
 Flink SQL> SET 'table.catalog-modification.listeners' = 'your_factory';
 Flink SQL> CREATE TABLE test_table(...);
 ```
+
+## Catalog Store
+
+Catalog Store is used to store the configuration of catalogs. When using 
Catalog Store, the configurations
+of catalogs created in the session will be persisted in the corresponding 
external system of Catalog Store.
+Even if the session is reconstructed, previously created catalogs can still be 
retrieved from Catalog Store.
+
+### Configure Catalog Store
+Users can configure the Catalog Store in different ways, one is to use the 
Table API, and another is to use YAML configuration.
+
+Register a catalog store using catalog store instance.
+
+```java
+// Initialize a catalog Store instance
+CatalogStore catalogStore = new 
FileCatalogStore("file://path/to/catalog/store/");
+
+// set up the catalog store
+final EnvironmentSettings settings =
+        EnvironmentSettings.newInstance().inBatchMode()
+        .withCatalogStore(catalogStore)
+        .build();
+```
+
+Register a catalog store using configuration.
+
+```java 
+// Set up configuration
+Configuration configuration = new Configuration();
+configuration.set("table.catalog-store.kind", "file");
+configuration.set("table.catalog-store.file.path", 
"file://path/to/catalog/store/");
+// set up the configuration.
+final EnvironmentSettings settings =
+        EnvironmentSettings.newInstance().inBatchMode()
+        .withConfiguration(configuration)
+        .build();
+
+final TableEnvironment tableEnv = TableEnvironment.create(settings);
+```
+
+In SQL Gateway, it is recommended to configure the settings in a yaml file so 
that all sessions can automatically
+use the pre-created Catalog. Usually, you need to configure the kind of 
Catalog Store and other
+required parameters for the Catalog Store.
+```yaml
+table.catalog-store.kind: file
+table.catalog-store.file.path: /path/to/catalog/store/
+```
+
+### Catalog Store Type
+Flink has two built-in Catalog Stores, namely GenericInMemoryCatalogStore and 
FileCatalogStore.
+Users can also customize their own Catalog Store.
+
+#### GenericInMemoryCatalogStore
+GenericInMemoryCatalogStore is an implementation of CatalogStore that saves 
configuration information in memory.
+All catalog configurations are only available within the session's lifecycle, 
and the stored catalog configurations will be
+automatically cleared after session reconstruction.
+
+<table class="table table-bordered">
+    <thead>
+      <tr>
+        <th class="text-left" style="width: 25%">Option</th>
+        <th class="text-center" style="width: 45%">Description</th>
+      </tr>
+    </thead>
+    <tbody>
+    <tr>
+      <td><h5>kind</h5></td>
+      <td>Specify the Catalog Store type to be used, which should be 
'generic_in_memory'</td>
+    </tr>
+    </tbody>
+</table>
+
+#### FileCatalogStore
+FileCatalogStore can save the user's Catalog configuration to a file. 
Currently, it only supports
+local files. To use FileCatalogStore, you need to specify the directory where 
the Catalog configuration

Review Comment:
   Currently FLINK-32660 has been merged and catalog store supports external 
file systems, I think we should update the doc



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to