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


##########
docs/content/docs/dev/table/catalogs.md:
##########
@@ -738,3 +738,192 @@ Flink SQL> show tables;
 ```
 {{< /tab >}}
 {{< /tabs >}}
+
+## 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.
+
+{{< tabs "9bb8994c-7c07-4c49-f5b8-f4ae3548ead4" >}}
+{{< tab "Java/Scala" >}}
+```java
+// Register a catalog store using catalog store instance.
+
+// Initialize a catalog Store
+CatalogStore catalogStore = new 
FileCatalogStore("file://path/to/catalog/store/");
+
+// set up the catalog store
+final EnvironmentSettings settings =
+        EnvironmentSettings.newInstance().inBatchMode()
+        .withCatalogStore(catalogStore)
+        .build();
+
+final TableEnvironment tableEnv = TableEnvironment.create(settings);
+
+// Register a catalog store using configuration.
+        
+// 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);
+```
+{{< /tab >}}
+{{< tab "SQL Gateway" >}}
+
+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/
+```
+{{< /tab >}}
+{{< /tabs >}}
+
+### Catalog Store Type
+Flink has two built-in Catalog Stores, namely GenericInMemoryCatalogStore and 
FileCatalogStore.
+Users can also customize their own Catalog Store.

Review Comment:
   Give an example for {catalog name}.yaml in the file path



-- 
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