Skip to content

Commit 181933b

Browse files
authored
[feat](bi) support default_init_catalog user property for external catalog (#2359)
Add docs for pr: apache/doris#49658 ## Versions - [x] dev - [ ] 3.0 - [ ] 2.1 - [ ] 2.0 ## Languages - [x] Chinese - [x] English ## Docs Checklist - [ ] Checked by AI - [ ] Test Cases Built
1 parent 798c685 commit 181933b

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

docs/lakehouse/catalog-overview.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,17 @@ jdbc:mysql://host:9030/iceberg_catalog.iceberg_db
154154

155155
The fixed name for the built-in catalog is `internal`. The switching method is the same as for external catalogs.
156156

157+
### Default Catalog
158+
The user attribute `default_init_catalog` is used to set the default catalog for a specific user. Once set, when the specified user connects to Doris, they will automatically switch to the set catalog.
159+
160+
```sql
161+
SET PROPERTY default_init_catalog=hive_catalog;
162+
```
163+
164+
Note 1: If the catalog has been explicitly specified in the MySQL command line or JDBC connection strings, then the specified catalog will be used, and the `default_init_catalog` user attribute will not take effect.
165+
Note 2: If the catalog set by the user attribute `default_init_catalog` no longer exists, it will automatically switch to the default `internal` catalog.
166+
Note 3: This feature takes effect starting from version v3.1.x.
167+
157168
### Simple Query
158169

159170
You can query tables in external catalogs using any SQL statement supported by Doris.

i18n/zh-CN/docusaurus-plugin-content-docs/current/lakehouse/catalog-overview.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,18 @@ jdbc:mysql://host:9030/iceberg_catalog.iceberg_db
153153

154154
内置数据目录的固定名称为 `internal`。切换方式和外部数据目录一致。
155155

156+
### 默认数据目录
157+
158+
通过用户属性 `default_init_catalog`,为指定用户设置默认的数据目录。设置完成后,当指定用户连接 Doris 时,会自动切换到设置的数据目录。
159+
160+
```sql
161+
SET PROPERTY default_init_catalog=hive_catalog;
162+
```
163+
164+
注意1:如果 MySQL 命令行或 JDBC 连接串中已经明确指定了数据目录,则以指定的为准,`default_init_catalog` 用户属性不生效;
165+
注意2:如果用户属性 `default_init_catalog` 设置的数据目录已经不存在,则自动切换到默认的 `internal` 数据目录;
166+
注意3:该功能从 v3.1.x 版本开始生效;
167+
156168
### 简单查询
157169

158170
可以通过 Doris 支持的任意 SQL 语句查询外部数据目录中的表。

0 commit comments

Comments
 (0)