Skip to content

[feat](bi) support default_init_catalog user property for external catalog #2359

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions docs/lakehouse/catalog-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,17 @@ jdbc:mysql://host:9030/iceberg_catalog.iceberg_db

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

### Default Catalog
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.

```sql
SET PROPERTY default_init_catalog=hive_catalog;
```

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.
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.
Note 3: This feature takes effect starting from version v3.1.x.

### Simple Query

You can query tables in external catalogs using any SQL statement supported by Doris.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,18 @@ jdbc:mysql://host:9030/iceberg_catalog.iceberg_db

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

### 默认数据目录

通过用户属性 `default_init_catalog`,为指定用户设置默认的数据目录。设置完成后,当指定用户连接 Doris 时,会自动切换到设置的数据目录。

```sql
SET PROPERTY default_init_catalog=hive_catalog;
```

注意1:如果 MySQL 命令行或 JDBC 连接串中已经明确指定了数据目录,则以指定的为准,`default_init_catalog` 用户属性不生效;
注意2:如果用户属性 `default_init_catalog` 设置的数据目录已经不存在,则自动切换到默认的 `internal` 数据目录;
注意3:该功能从 v3.1.x 版本开始生效;

### 简单查询

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