This is an automated email from the ASF dual-hosted git repository.

zykkk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 3e9ba632d7 [typo](docs) Add a guide to using SQL for the jdbc catalog 
(#22880)
3e9ba632d7 is described below

commit 3e9ba632d7469e637d231176e57feaa694e6ddce
Author: zy-kkk <[email protected]>
AuthorDate: Fri Aug 11 16:28:42 2023 +0800

    [typo](docs) Add a guide to using SQL for the jdbc catalog (#22880)
---
 docs/en/docs/lakehouse/multi-catalog/jdbc.md    | 75 +++++++++++++++++++++++++
 docs/zh-CN/docs/lakehouse/multi-catalog/jdbc.md | 75 +++++++++++++++++++++++++
 2 files changed, 150 insertions(+)

diff --git a/docs/en/docs/lakehouse/multi-catalog/jdbc.md 
b/docs/en/docs/lakehouse/multi-catalog/jdbc.md
index a174977669..e6e969ddf3 100644
--- a/docs/en/docs/lakehouse/multi-catalog/jdbc.md
+++ b/docs/en/docs/lakehouse/multi-catalog/jdbc.md
@@ -35,6 +35,13 @@ Once connected, Doris will ingest metadata of databases and 
tables from the exte
 
 Supported datas sources include MySQL, PostgreSQL, Oracle, SQLServer, 
Clickhouse, Doris, SAP HANA, Trino and OceanBase.
 
+## Syntax
+
+```sql
+CREATE CATALOG <catalog_name>
+PROPERTIES ("key"="value", ...)
+```
+
 ## Parameter Description
 
 | Parameter                 | Required or Not | Default Value | Description    
                                                                                
                          |
@@ -552,6 +559,74 @@ CREATE CATALOG jdbc_oceanbase PROPERTIES (
 When Doris connects to OceanBase, it will automatically recognize that 
OceanBase is in MySQL or Oracle mode. Hierarchical correspondence and type 
mapping refer to [MySQL](#MySQL) and [Oracle](#Oracle)
 :::
 
+### View the JDBC Catalog
+
+You can query all Catalogs in the current Doris cluster through SHOW CATALOGS:
+
+```sql
+SHOW CATALOGS;
+```
+
+Query the creation statement of a Catalog through SHOW CREATE CATALOG:
+
+```sql
+SHOW CREATE CATALOG <catalog_name>;
+```
+
+### Drop the JDBC Catalog
+
+A Catalog can be deleted via DROP CATALOG:
+
+```sql
+DROP CATALOG <catalog_name>;
+```
+
+### Query the JDBC Catalog
+
+1. Use SWITCH to switch the Catalog in effect for the current session:
+
+    ```sql
+    SWITCH <catalog_name>;
+    ```
+
+2. Query all libraries under the current Catalog through SHOW DATABASES:
+
+    ```sql
+    SHOW DATABASES FROM <catalog_name>;
+    ```
+
+    ```sql
+    SHOW DATABASES;
+    ```
+
+3. Use USE to switch the Database that takes effect in the current session:
+
+    ```sql
+    USE <database_name>;
+    ```
+
+   Or directly use `USE <catalog_name>.<database_name>;` to switch the 
Database that takes effect in the current session
+
+4. Query all tables under the current Catalog through SHOW TABLES:
+
+    ```sql
+    SHOW TABLES FROM <catalog_name>.<database_name>;
+    ```
+
+    ```sql
+    SHOW TABLES FROM <database_name>;
+    ```
+
+    ```sql
+    SHOW TABLES;
+    ```
+
+5. Query the data of a table under the current Catalog through SELECT:
+
+    ```sql
+    SELECT * FROM <table_name>;
+    ```
+
 ## FAQ
 
 1. Are there any other databases supported besides MySQL, Oracle, PostgreSQL, 
SQLServer, ClickHouse, SAP HANA, Trino and OceanBase?
diff --git a/docs/zh-CN/docs/lakehouse/multi-catalog/jdbc.md 
b/docs/zh-CN/docs/lakehouse/multi-catalog/jdbc.md
index 582fc4c20f..75e81c2177 100644
--- a/docs/zh-CN/docs/lakehouse/multi-catalog/jdbc.md
+++ b/docs/zh-CN/docs/lakehouse/multi-catalog/jdbc.md
@@ -35,6 +35,13 @@ JDBC Catalog 通过标准 JDBC 协议,连接其他数据源。
 
 支持 MySQL、PostgreSQL、Oracle、SQLServer、Clickhouse、Doris、SAP 
HANA、Trino/Presto、OceanBase
 
+## 语法
+    
+```sql
+CREATE CATALOG <catalog_name>
+PROPERTIES ("key"="value", ...)
+```
+
 ## 参数说明
 
 | 参数                      | 必须 | 默认值  | 说明                                     
                                                     |
@@ -553,6 +560,74 @@ CREATE CATALOG jdbc_oceanbase PROPERTIES (
  Doris 在连接 OceanBase 时,会自动识别 OceanBase 处于 MySQL 或者 Oracle 模式,层级对应和类型映射参考 
[MySQL](#MySQL) 与 [Oracle](#Oracle)
 :::
 
+### 查看 JDBC Catalog
+
+可以通过 SHOW CATALOGS 查询当前所在 Doris 集群里所有 Catalog:
+
+```sql
+SHOW CATALOGS;
+```
+
+通过 SHOW CREATE CATALOG 查询某个 Catalog 的创建语句:
+
+```sql
+SHOW CREATE CATALOG <catalog_name>;
+```
+
+### 删除 JDBC Catalog
+
+可以通过 DROP CATALOG 删除某个 Catalog:
+
+```sql
+DROP CATALOG <catalog_name>;
+```
+
+### 查询 JDBC Catalog
+
+1. 通过 SWITCH 切换当前会话生效的 Catalog:
+
+    ```sql
+    SWITCH <catalog_name>;
+    ```
+
+2. 通过 SHOW DATABASES 查询当前 Catalog 下的所有库:
+
+    ```sql
+    SHOW DATABASES FROM <catalog_name>;
+    ```
+
+    ```sql
+    SHOW DATABASES;
+    ```
+
+3. 通过 USE 切换当前会话生效的 Database:
+
+    ```sql
+    USE <database_name>;
+    ```
+
+    或者直接通过 `USE <catalog_name>.<database_name>;` 切换当前会话生效的 Database
+
+4. 通过 SHOW TABLES 查询当前 Catalog 下的所有表:
+
+    ```sql
+    SHOW TABLES FROM <catalog_name>.<database_name>;
+    ```
+
+    ```sql
+    SHOW TABLES FROM <database_name>;
+    ```
+
+    ```sql
+    SHOW TABLES;
+    ```
+
+5. 通过 SELECT 查询当前 Catalog 下的某个表的数据:
+
+    ```sql
+    SELECT * FROM <table_name>;
+    ```
+
 ## 常见问题
 
 1. 除了 MySQL,Oracle,PostgreSQL,SQLServer,ClickHouse,SAP 
HANA,Trino/Presto,OceanBase 是否能够支持更多的数据库


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to