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

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


The following commit(s) were added to refs/heads/master by this push:
     new 1c99e883c47 [feat](iceberg) add create/drop/insert branch/tag (#2692)
1c99e883c47 is described below

commit 1c99e883c47cf2214ea3f6a44d0c053a7ddf43cf
Author: Mingyu Chen (Rayner) <[email protected]>
AuthorDate: Fri Aug 1 21:34:07 2025 -0700

    [feat](iceberg) add create/drop/insert branch/tag (#2692)
    
    ## Versions
    
    - [x] dev
    - [x] 3.0
    - [x] 2.1
    - [ ] 2.0
    
    ## Languages
    
    - [x] Chinese
    - [x] English
    
    ## Docs Checklist
    
    - [ ] Checked by AI
    - [ ] Test Cases Built
---
 docs/lakehouse/catalogs/iceberg-catalog.md         | 112 ++++++++++++++++++++-
 .../current/lakehouse/catalogs/iceberg-catalog.md  | 108 ++++++++++++++++++++
 .../lakehouse/catalogs/iceberg-catalog.md          | 108 ++++++++++++++++++++
 .../lakehouse/catalogs/iceberg-catalog.md          | 108 ++++++++++++++++++++
 .../lakehouse/catalogs/iceberg-catalog.md          | 112 ++++++++++++++++++++-
 .../lakehouse/catalogs/iceberg-catalog.md          | 112 ++++++++++++++++++++-
 6 files changed, 654 insertions(+), 6 deletions(-)

diff --git a/docs/lakehouse/catalogs/iceberg-catalog.md 
b/docs/lakehouse/catalogs/iceberg-catalog.md
index b0327ee20e7..dde2c214906 100644
--- a/docs/lakehouse/catalogs/iceberg-catalog.md
+++ b/docs/lakehouse/catalogs/iceberg-catalog.md
@@ -310,7 +310,9 @@ SELECT * FROM iceberg_table FOR VERSION AS OF 123456789;
 
 ### Branch and Tag
 
-> This feature is supported since version 3.1.0
+> Since 3.1.0
+>
+> For creating, dropping and managing branch and tag, please refer to 
[Managing Branch & Tag]
 
 Reading specific branches and tags of Iceberg tables is supported.
 
@@ -332,7 +334,7 @@ For the `FOR VERSION AS OF` syntax, Doris will 
automatically determine whether t
 
 ## System Tables
 
-> This feature is supported since version 3.1.0
+> Since 3.1.0
 
 Doris supports querying Iceberg system tables to retrieve metadata information 
about tables. You can use system tables to view snapshot history, manifest 
files, data files, partitions, and other metadata.
 
@@ -586,6 +588,15 @@ PROPERTIES (
 AS SELECT col1, pt1 AS col2, pt2 AS pt1 FROM test_ctas.part_ctas_src WHERE 
col1 > 0;
 ```
 
+### INSERT INTO BRANCH
+
+> Since 3.1.0
+
+```sql
+INSERT INTO iceberg_table@branch(b1) SELECT * FROM other_table;
+INSERT OVERWRITE TABLE iceberg_table@branch(b1) SELECT * FROM other_table;
+```
+
 ### Related Parameters
 
 * BE (Backend)
@@ -824,6 +835,103 @@ Use `ORDER BY` to reorder columns by specifying the new 
column order.
 ALTER TABLE iceberg_table ORDER BY (col_name1, col_name2, ...);
 ```
 
+### Managing Branch & Tag
+
+> Since 3.1.0
+
+* **Create Branch**
+
+  Syntax:
+
+  ```sql
+  ALTER TABLE [catalog.][database.]table_name
+  CREATE [OR REPLACE] BRANCH [IF NOT EXISTS] <branch_name>
+  [AS OF VERSION <snapshot_id>]
+  [RETAIN <num> { DAYS | HOURS | MINUTES }]
+  [WITH SNAPSHOT RETENTION { snapshotKeep | timeKeep }]
+
+  snapshotKeep:
+    <num> SNAPSHOTS [<num> { DAYS | HOURS | MINUTES }]
+
+  timeKeep:
+    <num> { DAYS | HOURS | MINUTES }
+  ```
+
+  Examples:
+
+  ```sql
+  -- Create branch "b1".
+  ALTER TABLE tbl CREATE BRANCH b1;
+  ALTER TABLE tb1 CREATE BRANCH IF NOT EXISTS b1;
+  -- Create or replace branch "b1".
+  ALTER TABLE tb1 CREATE OR REPLACE BRANCH b1;
+  -- Create or replace branch "b1" based on snapshot "123456".
+  ALTER TABLE tb1 CREATE OR REPLACE BRANCH b1 AS OF VERSION 123456;
+  -- Create or replace branch "b1" based on snapshot "123456", branch retained 
for 1 day.
+  ALTER TABLE tb1 CREATE OR REPLACE BRANCH b1 AS OF VERSION 123456 RETAIN 1 
DAYS;
+  -- Create branch "b1" based on snapshot "123456", branch retained for 30 
days. Keep the latest 3 snapshots in the branch.
+  ALTER TABLE tb1 CREATE BRANCH b1 AS OF VERSION 123456 RETAIN 30 DAYS WITH 
SNAPSHOT RETENTION 3 SNAPSHOTS;
+  -- Create branch "b1" based on snapshot "123456", branch retained for 30 
days. Snapshots in the branch are retained for at most 2 days.
+  ALTER TABLE tb1 CREATE BRANCH b1 AS OF VERSION 123456 RETAIN 30 DAYS WITH 
SNAPSHOT RETENTION 2 DAYS;
+  -- Create branch "b1" based on snapshot "123456", branch retained for 30 
days. Keep the latest 3 snapshots in the branch, and snapshots in the branch 
are retained for at most 2 days.
+  ALTER TABLE tb1 CREATE BRANCH b1 AS OF VERSION 123456 RETAIN 30 DAYS WITH 
SNAPSHOT RETENTION 3 SNAPSHOTS 2 DAYS;
+  ```
+
+* **Drop Branch**
+
+  Syntax:
+
+  ```sql
+  ALTER TABLE [catalog.][database.]table_name
+  DROP BRANCH [IF EXISTS] <branch_name>;
+  ```
+
+  Example:
+
+  ```sql
+  ALTER TABLE tbl DROP BRANCH b1;
+  ```
+
+* **Create Tag**
+
+  Syntax:
+
+  ```sql
+  ALTER TABLE [catalog.][database.]table_name
+  CREATE [OR REPLACE] TAG [IF NOT EXISTS] <tag_name>
+  [AS OF VERSION <snapshot_id>]
+  [RETAIN <num> { DAYS | HOURS | MINUTES }]
+  ```
+
+  Examples:
+
+  ```sql
+  -- Create tag "t1".
+  ALTER TABLE tbl CREATE TAG t1;
+  ALTER TABLE tb1 CREATE TAG IF NOT EXISTS t1;
+  -- Create or replace tag "t1".
+  ALTER TABLE tb1 CREATE OR REPLACE TAG t1;
+  -- Create or replace tag "t1" based on snapshot "123456".
+  ALTER TABLE tb1 CREATE OR REPLACE TAG b1 AS OF VERSION 123456;
+  -- Create or replace tag "b1" based on snapshot "123456", tag retained for 1 
day.
+  ALTER TABLE tb1 CREATE OR REPLACE TAG b1 AS OF VERSION 123456 RETAIN 1 DAYS;
+  ```
+
+* **Drop Tag**
+
+  Syntax:
+
+  ```sql
+  ALTER TABLE [catalog.][database.]table_name
+  DROP TAG [IF EXISTS] <tag_name>;
+  ```
+
+  Example:
+
+  ```sql
+  ALTER TABLE tbl DROP TAG t1;
+  ```
+
 ## Iceberg Table Optimization
 
 ### View Data File Distribution
diff --git 
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/lakehouse/catalogs/iceberg-catalog.md
 
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/lakehouse/catalogs/iceberg-catalog.md
index c1329491424..49f05f11052 100644
--- 
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/lakehouse/catalogs/iceberg-catalog.md
+++ 
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/lakehouse/catalogs/iceberg-catalog.md
@@ -321,6 +321,8 @@ SELECT * FROM iceberg_tbl FOR VERSION AS OF 868895038966572;
 ### Branch 和 Tag
 
 > 该功能自 3.1.0 版本支持
+>
+> 关于 Branch、Tag 的创建、删除和维护操作,请参阅【管理 Branch & Tag】
 
 支持读取指定 Iceberg 表的分支(Branch)和标签(Tag)。
 
@@ -595,6 +597,15 @@ PROPERTIES (
 AS SELECT col1,pt1 as col2,pt2 as pt1 FROM test_ctas.part_ctas_src WHERE 
col1>0;
 ```
 
+### 写入数据到 Branch
+
+> 该功能自 3.1.0 版本支持
+
+```sql
+INSERT INTO iceberg_table@branch(b1) SELECT * FROM other_table;
+INSERT OVERWRITE TABLE iceberg_table@branch(b1) SELECT * FROM other_table;
+```
+
 ### 相关参数
 
 * BE
@@ -832,6 +843,103 @@ ALTER TABLE iceberg_table MODIFY COLUMN id BIGINT NOT 
NULL DEFAULT 0 COMMENT 'Th
 ALTER TABLE iceberg_table ORDER BY (col_name1, col_name2, ...);
 ```
 
+### 管理 Branch & Tag
+
+> 该功能自 3.1.0 版本支持
+
+* **创建 Branch**
+
+  语法:
+
+  ```sql
+  ALTER TABLE [catalog.][database.]table_name
+  CREATE [OR REPLACE] BRANCH [IF NOT EXISTS] <branch_name>
+  [AS OF VERSION <snapshot_id>]
+  [RETAIN <num> { DAYS | HOURS | MINUTES }]
+  [WITH SNAPSHOT RETENTION { snapshotKeep | timeKeep }]
+
+  snapshotKeep:
+    <num> SNAPSHOTS [<num> { DAYS | HOURS | MINUTES }]
+
+  timeKeep:
+    <num> { DAYS | HOURS | MINUTES }
+  ```
+
+  示例:
+
+  ```sql
+  -- 创建分支 "b1"。
+  ALTER TABLE tbl CREATE BRANCH b1;
+  ALTER TABLE tb1 CREATE BRANCH IF NOT EXISTS b1;
+  -- 创建或替换分支 "b1"。
+  ALTER TABLE tb1 CREATE OR REPLACE BRANCH b1;
+  -- 基于快照 "123456" 创建或替换分支 "b1"。
+  ALTER TABLE tb1 CREATE OR REPLACE BRANCH b1 AS OF VERSION 123456;
+  -- 基于快照 "123456" 创建或替换分支 "b1",分支保留 1 天。
+  ALTER TABLE tb1 CREATE OR REPLACE BRANCH b1 AS OF VERSION 123456 RETAIN 1 
DAYS;
+  -- 基于快照 "123456" 创建分支 "b1",分支保留 30 天。分支中的保留最近的 3 个快照。
+  ALTER TABLE tb1 CREATE BRANCH b1 AS OF VERSION 123456 RETAIN 30 DAYS WITH 
SNAPSHOT RETENTION 3 SNAPSHOTS;
+  -- 基于快照 "123456" 创建分支 "b1",分支保留 30 天。分支中的快照最多保留 2 天。
+  ALTER TABLE tb1 CREATE BRANCH b1 AS OF VERSION 123456 RETAIN 30 DAYS WITH 
SNAPSHOT RETENTION 2 DAYS;
+  -- 基于快照 "123456" 创建分支 "b1",分支保留 30 天。分支中的保留最近的 3 个快照,分支中的快照最多保留 2 天。
+  ALTER TABLE tb1 CREATE BRANCH b1 AS OF VERSION 123456 RETAIN 30 DAYS WITH 
SNAPSHOT RETENTION 3 SNAPSHOTS 2 DAYS;
+  ```
+
+* **删除 Branch**
+
+  语法:
+
+  ```sql
+  ALTER TABLE [catalog.][database.]table_name
+  DROP BRANCH [IF EXISTS] <branch_name>;
+  ```
+
+  示例:
+
+  ```sql
+  ALTER TABLE tbl DROP BRANCH b1;
+  ```
+
+* **创建 Tag**
+
+  语法:
+
+  ```sql
+  ALTER TABLE [catalog.][database.]table_name
+  CREATE [OR REPLACE] TAG [IF NOT EXISTS] <tag_name>
+  [AS OF VERSION <snapshot_id>]
+  [RETAIN <num> { DAYS | HOURS | MINUTES }]
+  ```
+
+  示例:
+
+  ```sql
+  -- 创建标记 "t1"。
+  ALTER TABLE tbl CREATE TAG t1;
+  ALTER TABLE tb1 CREATE TAG IF NOT EXISTS t1;
+  -- 创建或替换标记 "t1"。
+  ALTER TABLE tb1 CREATE OR REPLACE TAG t1;
+  -- 基于快照 "123456" 创建或替换标记 "t1"。
+  ALTER TABLE tb1 CREATE OR REPLACE TAG b1 AS OF VERSION 123456;
+  -- 基于快照 "123456" 创建或替换标记 "b1",标记保留 1 天。
+  ALTER TABLE tb1 CREATE OR REPLACE TAG b1 AS OF VERSION 123456 RETAIN 1 DAYS;
+  ```
+
+* **删除 Tag**
+
+  语法:
+
+  ```sql
+  ALTER TABLE [catalog.][database.]table_name
+  DROP TAG [IF EXISTS] <tag_name>;
+  ```
+
+  示例:
+
+  ```sql
+  ALTER TABLE tbl DROP TAG t1;
+  ```
+
 ## Iceberg 表优化
 
 ### 查看数据文件分布
diff --git 
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/lakehouse/catalogs/iceberg-catalog.md
 
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/lakehouse/catalogs/iceberg-catalog.md
index c1329491424..49f05f11052 100644
--- 
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/lakehouse/catalogs/iceberg-catalog.md
+++ 
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/lakehouse/catalogs/iceberg-catalog.md
@@ -321,6 +321,8 @@ SELECT * FROM iceberg_tbl FOR VERSION AS OF 868895038966572;
 ### Branch 和 Tag
 
 > 该功能自 3.1.0 版本支持
+>
+> 关于 Branch、Tag 的创建、删除和维护操作,请参阅【管理 Branch & Tag】
 
 支持读取指定 Iceberg 表的分支(Branch)和标签(Tag)。
 
@@ -595,6 +597,15 @@ PROPERTIES (
 AS SELECT col1,pt1 as col2,pt2 as pt1 FROM test_ctas.part_ctas_src WHERE 
col1>0;
 ```
 
+### 写入数据到 Branch
+
+> 该功能自 3.1.0 版本支持
+
+```sql
+INSERT INTO iceberg_table@branch(b1) SELECT * FROM other_table;
+INSERT OVERWRITE TABLE iceberg_table@branch(b1) SELECT * FROM other_table;
+```
+
 ### 相关参数
 
 * BE
@@ -832,6 +843,103 @@ ALTER TABLE iceberg_table MODIFY COLUMN id BIGINT NOT 
NULL DEFAULT 0 COMMENT 'Th
 ALTER TABLE iceberg_table ORDER BY (col_name1, col_name2, ...);
 ```
 
+### 管理 Branch & Tag
+
+> 该功能自 3.1.0 版本支持
+
+* **创建 Branch**
+
+  语法:
+
+  ```sql
+  ALTER TABLE [catalog.][database.]table_name
+  CREATE [OR REPLACE] BRANCH [IF NOT EXISTS] <branch_name>
+  [AS OF VERSION <snapshot_id>]
+  [RETAIN <num> { DAYS | HOURS | MINUTES }]
+  [WITH SNAPSHOT RETENTION { snapshotKeep | timeKeep }]
+
+  snapshotKeep:
+    <num> SNAPSHOTS [<num> { DAYS | HOURS | MINUTES }]
+
+  timeKeep:
+    <num> { DAYS | HOURS | MINUTES }
+  ```
+
+  示例:
+
+  ```sql
+  -- 创建分支 "b1"。
+  ALTER TABLE tbl CREATE BRANCH b1;
+  ALTER TABLE tb1 CREATE BRANCH IF NOT EXISTS b1;
+  -- 创建或替换分支 "b1"。
+  ALTER TABLE tb1 CREATE OR REPLACE BRANCH b1;
+  -- 基于快照 "123456" 创建或替换分支 "b1"。
+  ALTER TABLE tb1 CREATE OR REPLACE BRANCH b1 AS OF VERSION 123456;
+  -- 基于快照 "123456" 创建或替换分支 "b1",分支保留 1 天。
+  ALTER TABLE tb1 CREATE OR REPLACE BRANCH b1 AS OF VERSION 123456 RETAIN 1 
DAYS;
+  -- 基于快照 "123456" 创建分支 "b1",分支保留 30 天。分支中的保留最近的 3 个快照。
+  ALTER TABLE tb1 CREATE BRANCH b1 AS OF VERSION 123456 RETAIN 30 DAYS WITH 
SNAPSHOT RETENTION 3 SNAPSHOTS;
+  -- 基于快照 "123456" 创建分支 "b1",分支保留 30 天。分支中的快照最多保留 2 天。
+  ALTER TABLE tb1 CREATE BRANCH b1 AS OF VERSION 123456 RETAIN 30 DAYS WITH 
SNAPSHOT RETENTION 2 DAYS;
+  -- 基于快照 "123456" 创建分支 "b1",分支保留 30 天。分支中的保留最近的 3 个快照,分支中的快照最多保留 2 天。
+  ALTER TABLE tb1 CREATE BRANCH b1 AS OF VERSION 123456 RETAIN 30 DAYS WITH 
SNAPSHOT RETENTION 3 SNAPSHOTS 2 DAYS;
+  ```
+
+* **删除 Branch**
+
+  语法:
+
+  ```sql
+  ALTER TABLE [catalog.][database.]table_name
+  DROP BRANCH [IF EXISTS] <branch_name>;
+  ```
+
+  示例:
+
+  ```sql
+  ALTER TABLE tbl DROP BRANCH b1;
+  ```
+
+* **创建 Tag**
+
+  语法:
+
+  ```sql
+  ALTER TABLE [catalog.][database.]table_name
+  CREATE [OR REPLACE] TAG [IF NOT EXISTS] <tag_name>
+  [AS OF VERSION <snapshot_id>]
+  [RETAIN <num> { DAYS | HOURS | MINUTES }]
+  ```
+
+  示例:
+
+  ```sql
+  -- 创建标记 "t1"。
+  ALTER TABLE tbl CREATE TAG t1;
+  ALTER TABLE tb1 CREATE TAG IF NOT EXISTS t1;
+  -- 创建或替换标记 "t1"。
+  ALTER TABLE tb1 CREATE OR REPLACE TAG t1;
+  -- 基于快照 "123456" 创建或替换标记 "t1"。
+  ALTER TABLE tb1 CREATE OR REPLACE TAG b1 AS OF VERSION 123456;
+  -- 基于快照 "123456" 创建或替换标记 "b1",标记保留 1 天。
+  ALTER TABLE tb1 CREATE OR REPLACE TAG b1 AS OF VERSION 123456 RETAIN 1 DAYS;
+  ```
+
+* **删除 Tag**
+
+  语法:
+
+  ```sql
+  ALTER TABLE [catalog.][database.]table_name
+  DROP TAG [IF EXISTS] <tag_name>;
+  ```
+
+  示例:
+
+  ```sql
+  ALTER TABLE tbl DROP TAG t1;
+  ```
+
 ## Iceberg 表优化
 
 ### 查看数据文件分布
diff --git 
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/lakehouse/catalogs/iceberg-catalog.md
 
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/lakehouse/catalogs/iceberg-catalog.md
index c1329491424..49f05f11052 100644
--- 
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/lakehouse/catalogs/iceberg-catalog.md
+++ 
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/lakehouse/catalogs/iceberg-catalog.md
@@ -321,6 +321,8 @@ SELECT * FROM iceberg_tbl FOR VERSION AS OF 868895038966572;
 ### Branch 和 Tag
 
 > 该功能自 3.1.0 版本支持
+>
+> 关于 Branch、Tag 的创建、删除和维护操作,请参阅【管理 Branch & Tag】
 
 支持读取指定 Iceberg 表的分支(Branch)和标签(Tag)。
 
@@ -595,6 +597,15 @@ PROPERTIES (
 AS SELECT col1,pt1 as col2,pt2 as pt1 FROM test_ctas.part_ctas_src WHERE 
col1>0;
 ```
 
+### 写入数据到 Branch
+
+> 该功能自 3.1.0 版本支持
+
+```sql
+INSERT INTO iceberg_table@branch(b1) SELECT * FROM other_table;
+INSERT OVERWRITE TABLE iceberg_table@branch(b1) SELECT * FROM other_table;
+```
+
 ### 相关参数
 
 * BE
@@ -832,6 +843,103 @@ ALTER TABLE iceberg_table MODIFY COLUMN id BIGINT NOT 
NULL DEFAULT 0 COMMENT 'Th
 ALTER TABLE iceberg_table ORDER BY (col_name1, col_name2, ...);
 ```
 
+### 管理 Branch & Tag
+
+> 该功能自 3.1.0 版本支持
+
+* **创建 Branch**
+
+  语法:
+
+  ```sql
+  ALTER TABLE [catalog.][database.]table_name
+  CREATE [OR REPLACE] BRANCH [IF NOT EXISTS] <branch_name>
+  [AS OF VERSION <snapshot_id>]
+  [RETAIN <num> { DAYS | HOURS | MINUTES }]
+  [WITH SNAPSHOT RETENTION { snapshotKeep | timeKeep }]
+
+  snapshotKeep:
+    <num> SNAPSHOTS [<num> { DAYS | HOURS | MINUTES }]
+
+  timeKeep:
+    <num> { DAYS | HOURS | MINUTES }
+  ```
+
+  示例:
+
+  ```sql
+  -- 创建分支 "b1"。
+  ALTER TABLE tbl CREATE BRANCH b1;
+  ALTER TABLE tb1 CREATE BRANCH IF NOT EXISTS b1;
+  -- 创建或替换分支 "b1"。
+  ALTER TABLE tb1 CREATE OR REPLACE BRANCH b1;
+  -- 基于快照 "123456" 创建或替换分支 "b1"。
+  ALTER TABLE tb1 CREATE OR REPLACE BRANCH b1 AS OF VERSION 123456;
+  -- 基于快照 "123456" 创建或替换分支 "b1",分支保留 1 天。
+  ALTER TABLE tb1 CREATE OR REPLACE BRANCH b1 AS OF VERSION 123456 RETAIN 1 
DAYS;
+  -- 基于快照 "123456" 创建分支 "b1",分支保留 30 天。分支中的保留最近的 3 个快照。
+  ALTER TABLE tb1 CREATE BRANCH b1 AS OF VERSION 123456 RETAIN 30 DAYS WITH 
SNAPSHOT RETENTION 3 SNAPSHOTS;
+  -- 基于快照 "123456" 创建分支 "b1",分支保留 30 天。分支中的快照最多保留 2 天。
+  ALTER TABLE tb1 CREATE BRANCH b1 AS OF VERSION 123456 RETAIN 30 DAYS WITH 
SNAPSHOT RETENTION 2 DAYS;
+  -- 基于快照 "123456" 创建分支 "b1",分支保留 30 天。分支中的保留最近的 3 个快照,分支中的快照最多保留 2 天。
+  ALTER TABLE tb1 CREATE BRANCH b1 AS OF VERSION 123456 RETAIN 30 DAYS WITH 
SNAPSHOT RETENTION 3 SNAPSHOTS 2 DAYS;
+  ```
+
+* **删除 Branch**
+
+  语法:
+
+  ```sql
+  ALTER TABLE [catalog.][database.]table_name
+  DROP BRANCH [IF EXISTS] <branch_name>;
+  ```
+
+  示例:
+
+  ```sql
+  ALTER TABLE tbl DROP BRANCH b1;
+  ```
+
+* **创建 Tag**
+
+  语法:
+
+  ```sql
+  ALTER TABLE [catalog.][database.]table_name
+  CREATE [OR REPLACE] TAG [IF NOT EXISTS] <tag_name>
+  [AS OF VERSION <snapshot_id>]
+  [RETAIN <num> { DAYS | HOURS | MINUTES }]
+  ```
+
+  示例:
+
+  ```sql
+  -- 创建标记 "t1"。
+  ALTER TABLE tbl CREATE TAG t1;
+  ALTER TABLE tb1 CREATE TAG IF NOT EXISTS t1;
+  -- 创建或替换标记 "t1"。
+  ALTER TABLE tb1 CREATE OR REPLACE TAG t1;
+  -- 基于快照 "123456" 创建或替换标记 "t1"。
+  ALTER TABLE tb1 CREATE OR REPLACE TAG b1 AS OF VERSION 123456;
+  -- 基于快照 "123456" 创建或替换标记 "b1",标记保留 1 天。
+  ALTER TABLE tb1 CREATE OR REPLACE TAG b1 AS OF VERSION 123456 RETAIN 1 DAYS;
+  ```
+
+* **删除 Tag**
+
+  语法:
+
+  ```sql
+  ALTER TABLE [catalog.][database.]table_name
+  DROP TAG [IF EXISTS] <tag_name>;
+  ```
+
+  示例:
+
+  ```sql
+  ALTER TABLE tbl DROP TAG t1;
+  ```
+
 ## Iceberg 表优化
 
 ### 查看数据文件分布
diff --git a/versioned_docs/version-2.1/lakehouse/catalogs/iceberg-catalog.md 
b/versioned_docs/version-2.1/lakehouse/catalogs/iceberg-catalog.md
index b0327ee20e7..dde2c214906 100644
--- a/versioned_docs/version-2.1/lakehouse/catalogs/iceberg-catalog.md
+++ b/versioned_docs/version-2.1/lakehouse/catalogs/iceberg-catalog.md
@@ -310,7 +310,9 @@ SELECT * FROM iceberg_table FOR VERSION AS OF 123456789;
 
 ### Branch and Tag
 
-> This feature is supported since version 3.1.0
+> Since 3.1.0
+>
+> For creating, dropping and managing branch and tag, please refer to 
[Managing Branch & Tag]
 
 Reading specific branches and tags of Iceberg tables is supported.
 
@@ -332,7 +334,7 @@ For the `FOR VERSION AS OF` syntax, Doris will 
automatically determine whether t
 
 ## System Tables
 
-> This feature is supported since version 3.1.0
+> Since 3.1.0
 
 Doris supports querying Iceberg system tables to retrieve metadata information 
about tables. You can use system tables to view snapshot history, manifest 
files, data files, partitions, and other metadata.
 
@@ -586,6 +588,15 @@ PROPERTIES (
 AS SELECT col1, pt1 AS col2, pt2 AS pt1 FROM test_ctas.part_ctas_src WHERE 
col1 > 0;
 ```
 
+### INSERT INTO BRANCH
+
+> Since 3.1.0
+
+```sql
+INSERT INTO iceberg_table@branch(b1) SELECT * FROM other_table;
+INSERT OVERWRITE TABLE iceberg_table@branch(b1) SELECT * FROM other_table;
+```
+
 ### Related Parameters
 
 * BE (Backend)
@@ -824,6 +835,103 @@ Use `ORDER BY` to reorder columns by specifying the new 
column order.
 ALTER TABLE iceberg_table ORDER BY (col_name1, col_name2, ...);
 ```
 
+### Managing Branch & Tag
+
+> Since 3.1.0
+
+* **Create Branch**
+
+  Syntax:
+
+  ```sql
+  ALTER TABLE [catalog.][database.]table_name
+  CREATE [OR REPLACE] BRANCH [IF NOT EXISTS] <branch_name>
+  [AS OF VERSION <snapshot_id>]
+  [RETAIN <num> { DAYS | HOURS | MINUTES }]
+  [WITH SNAPSHOT RETENTION { snapshotKeep | timeKeep }]
+
+  snapshotKeep:
+    <num> SNAPSHOTS [<num> { DAYS | HOURS | MINUTES }]
+
+  timeKeep:
+    <num> { DAYS | HOURS | MINUTES }
+  ```
+
+  Examples:
+
+  ```sql
+  -- Create branch "b1".
+  ALTER TABLE tbl CREATE BRANCH b1;
+  ALTER TABLE tb1 CREATE BRANCH IF NOT EXISTS b1;
+  -- Create or replace branch "b1".
+  ALTER TABLE tb1 CREATE OR REPLACE BRANCH b1;
+  -- Create or replace branch "b1" based on snapshot "123456".
+  ALTER TABLE tb1 CREATE OR REPLACE BRANCH b1 AS OF VERSION 123456;
+  -- Create or replace branch "b1" based on snapshot "123456", branch retained 
for 1 day.
+  ALTER TABLE tb1 CREATE OR REPLACE BRANCH b1 AS OF VERSION 123456 RETAIN 1 
DAYS;
+  -- Create branch "b1" based on snapshot "123456", branch retained for 30 
days. Keep the latest 3 snapshots in the branch.
+  ALTER TABLE tb1 CREATE BRANCH b1 AS OF VERSION 123456 RETAIN 30 DAYS WITH 
SNAPSHOT RETENTION 3 SNAPSHOTS;
+  -- Create branch "b1" based on snapshot "123456", branch retained for 30 
days. Snapshots in the branch are retained for at most 2 days.
+  ALTER TABLE tb1 CREATE BRANCH b1 AS OF VERSION 123456 RETAIN 30 DAYS WITH 
SNAPSHOT RETENTION 2 DAYS;
+  -- Create branch "b1" based on snapshot "123456", branch retained for 30 
days. Keep the latest 3 snapshots in the branch, and snapshots in the branch 
are retained for at most 2 days.
+  ALTER TABLE tb1 CREATE BRANCH b1 AS OF VERSION 123456 RETAIN 30 DAYS WITH 
SNAPSHOT RETENTION 3 SNAPSHOTS 2 DAYS;
+  ```
+
+* **Drop Branch**
+
+  Syntax:
+
+  ```sql
+  ALTER TABLE [catalog.][database.]table_name
+  DROP BRANCH [IF EXISTS] <branch_name>;
+  ```
+
+  Example:
+
+  ```sql
+  ALTER TABLE tbl DROP BRANCH b1;
+  ```
+
+* **Create Tag**
+
+  Syntax:
+
+  ```sql
+  ALTER TABLE [catalog.][database.]table_name
+  CREATE [OR REPLACE] TAG [IF NOT EXISTS] <tag_name>
+  [AS OF VERSION <snapshot_id>]
+  [RETAIN <num> { DAYS | HOURS | MINUTES }]
+  ```
+
+  Examples:
+
+  ```sql
+  -- Create tag "t1".
+  ALTER TABLE tbl CREATE TAG t1;
+  ALTER TABLE tb1 CREATE TAG IF NOT EXISTS t1;
+  -- Create or replace tag "t1".
+  ALTER TABLE tb1 CREATE OR REPLACE TAG t1;
+  -- Create or replace tag "t1" based on snapshot "123456".
+  ALTER TABLE tb1 CREATE OR REPLACE TAG b1 AS OF VERSION 123456;
+  -- Create or replace tag "b1" based on snapshot "123456", tag retained for 1 
day.
+  ALTER TABLE tb1 CREATE OR REPLACE TAG b1 AS OF VERSION 123456 RETAIN 1 DAYS;
+  ```
+
+* **Drop Tag**
+
+  Syntax:
+
+  ```sql
+  ALTER TABLE [catalog.][database.]table_name
+  DROP TAG [IF EXISTS] <tag_name>;
+  ```
+
+  Example:
+
+  ```sql
+  ALTER TABLE tbl DROP TAG t1;
+  ```
+
 ## Iceberg Table Optimization
 
 ### View Data File Distribution
diff --git a/versioned_docs/version-3.0/lakehouse/catalogs/iceberg-catalog.md 
b/versioned_docs/version-3.0/lakehouse/catalogs/iceberg-catalog.md
index b0327ee20e7..dde2c214906 100644
--- a/versioned_docs/version-3.0/lakehouse/catalogs/iceberg-catalog.md
+++ b/versioned_docs/version-3.0/lakehouse/catalogs/iceberg-catalog.md
@@ -310,7 +310,9 @@ SELECT * FROM iceberg_table FOR VERSION AS OF 123456789;
 
 ### Branch and Tag
 
-> This feature is supported since version 3.1.0
+> Since 3.1.0
+>
+> For creating, dropping and managing branch and tag, please refer to 
[Managing Branch & Tag]
 
 Reading specific branches and tags of Iceberg tables is supported.
 
@@ -332,7 +334,7 @@ For the `FOR VERSION AS OF` syntax, Doris will 
automatically determine whether t
 
 ## System Tables
 
-> This feature is supported since version 3.1.0
+> Since 3.1.0
 
 Doris supports querying Iceberg system tables to retrieve metadata information 
about tables. You can use system tables to view snapshot history, manifest 
files, data files, partitions, and other metadata.
 
@@ -586,6 +588,15 @@ PROPERTIES (
 AS SELECT col1, pt1 AS col2, pt2 AS pt1 FROM test_ctas.part_ctas_src WHERE 
col1 > 0;
 ```
 
+### INSERT INTO BRANCH
+
+> Since 3.1.0
+
+```sql
+INSERT INTO iceberg_table@branch(b1) SELECT * FROM other_table;
+INSERT OVERWRITE TABLE iceberg_table@branch(b1) SELECT * FROM other_table;
+```
+
 ### Related Parameters
 
 * BE (Backend)
@@ -824,6 +835,103 @@ Use `ORDER BY` to reorder columns by specifying the new 
column order.
 ALTER TABLE iceberg_table ORDER BY (col_name1, col_name2, ...);
 ```
 
+### Managing Branch & Tag
+
+> Since 3.1.0
+
+* **Create Branch**
+
+  Syntax:
+
+  ```sql
+  ALTER TABLE [catalog.][database.]table_name
+  CREATE [OR REPLACE] BRANCH [IF NOT EXISTS] <branch_name>
+  [AS OF VERSION <snapshot_id>]
+  [RETAIN <num> { DAYS | HOURS | MINUTES }]
+  [WITH SNAPSHOT RETENTION { snapshotKeep | timeKeep }]
+
+  snapshotKeep:
+    <num> SNAPSHOTS [<num> { DAYS | HOURS | MINUTES }]
+
+  timeKeep:
+    <num> { DAYS | HOURS | MINUTES }
+  ```
+
+  Examples:
+
+  ```sql
+  -- Create branch "b1".
+  ALTER TABLE tbl CREATE BRANCH b1;
+  ALTER TABLE tb1 CREATE BRANCH IF NOT EXISTS b1;
+  -- Create or replace branch "b1".
+  ALTER TABLE tb1 CREATE OR REPLACE BRANCH b1;
+  -- Create or replace branch "b1" based on snapshot "123456".
+  ALTER TABLE tb1 CREATE OR REPLACE BRANCH b1 AS OF VERSION 123456;
+  -- Create or replace branch "b1" based on snapshot "123456", branch retained 
for 1 day.
+  ALTER TABLE tb1 CREATE OR REPLACE BRANCH b1 AS OF VERSION 123456 RETAIN 1 
DAYS;
+  -- Create branch "b1" based on snapshot "123456", branch retained for 30 
days. Keep the latest 3 snapshots in the branch.
+  ALTER TABLE tb1 CREATE BRANCH b1 AS OF VERSION 123456 RETAIN 30 DAYS WITH 
SNAPSHOT RETENTION 3 SNAPSHOTS;
+  -- Create branch "b1" based on snapshot "123456", branch retained for 30 
days. Snapshots in the branch are retained for at most 2 days.
+  ALTER TABLE tb1 CREATE BRANCH b1 AS OF VERSION 123456 RETAIN 30 DAYS WITH 
SNAPSHOT RETENTION 2 DAYS;
+  -- Create branch "b1" based on snapshot "123456", branch retained for 30 
days. Keep the latest 3 snapshots in the branch, and snapshots in the branch 
are retained for at most 2 days.
+  ALTER TABLE tb1 CREATE BRANCH b1 AS OF VERSION 123456 RETAIN 30 DAYS WITH 
SNAPSHOT RETENTION 3 SNAPSHOTS 2 DAYS;
+  ```
+
+* **Drop Branch**
+
+  Syntax:
+
+  ```sql
+  ALTER TABLE [catalog.][database.]table_name
+  DROP BRANCH [IF EXISTS] <branch_name>;
+  ```
+
+  Example:
+
+  ```sql
+  ALTER TABLE tbl DROP BRANCH b1;
+  ```
+
+* **Create Tag**
+
+  Syntax:
+
+  ```sql
+  ALTER TABLE [catalog.][database.]table_name
+  CREATE [OR REPLACE] TAG [IF NOT EXISTS] <tag_name>
+  [AS OF VERSION <snapshot_id>]
+  [RETAIN <num> { DAYS | HOURS | MINUTES }]
+  ```
+
+  Examples:
+
+  ```sql
+  -- Create tag "t1".
+  ALTER TABLE tbl CREATE TAG t1;
+  ALTER TABLE tb1 CREATE TAG IF NOT EXISTS t1;
+  -- Create or replace tag "t1".
+  ALTER TABLE tb1 CREATE OR REPLACE TAG t1;
+  -- Create or replace tag "t1" based on snapshot "123456".
+  ALTER TABLE tb1 CREATE OR REPLACE TAG b1 AS OF VERSION 123456;
+  -- Create or replace tag "b1" based on snapshot "123456", tag retained for 1 
day.
+  ALTER TABLE tb1 CREATE OR REPLACE TAG b1 AS OF VERSION 123456 RETAIN 1 DAYS;
+  ```
+
+* **Drop Tag**
+
+  Syntax:
+
+  ```sql
+  ALTER TABLE [catalog.][database.]table_name
+  DROP TAG [IF EXISTS] <tag_name>;
+  ```
+
+  Example:
+
+  ```sql
+  ALTER TABLE tbl DROP TAG t1;
+  ```
+
 ## Iceberg Table Optimization
 
 ### View Data File Distribution


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

Reply via email to