File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed
i18n/zh-CN/docusaurus-plugin-content-docs/current/lakehouse/catalogs Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change @@ -2210,6 +2210,49 @@ EXECUTE set_current_snapshot ("ref" = "v1.0");
221022103 . 如果指定的快照 ID 或引用不存在,操作会失败
221122114 . 如果当前快照已经是目标快照,操作会直接返回,不会创建新快照
22122212
2213+ ### publish_changes
2214+
2215+ ` publish_changes ` 操作用于在 WAP(Write-Audit-Publish)模式下,将带有指定 ` wap.id ` 的快照发布为当前表状态。
2216+ 它会找到与给定 ` wap_id ` 匹配的快照,并通过 * cherrypick* 的方式将其合并到当前表中,使这批暂存数据对所有读取操作可见。
2217+
2218+ ** 语法:**
2219+
2220+ ``` sql
2221+ ALTER TABLE [catalog.][database.]table_name
2222+ EXECUTE publish_changes(" wap_id" = " <wap_id>" )
2223+ ```
2224+
2225+ ** 参数说明:**
2226+
2227+ | 参数名称 | 类型 | 必填 | 描述 |
2228+ | -------- | ---- | ---- | ---- |
2229+ | ` wap_id ` | STRING | 是 | 要发布的 WAP 快照 ID |
2230+
2231+ ** 返回值:**
2232+
2233+ 执行 ` publish_changes ` 操作会返回一个结果集,包含以下 2 列:
2234+
2235+ | 列名 | 类型 | 描述 |
2236+ | ---- | ---- | ---- |
2237+ | ` previous_snapshot_id ` | STRING | 发布操作前当前快照的 ID(如果不存在则为 NULL) |
2238+ | ` current_snapshot_id ` | STRING | 发布操作后新创建并设置为当前快照的 ID |
2239+
2240+ ** 示例:**
2241+
2242+ ``` sql
2243+ -- 发布 WAP ID 为 test_wap_001 的快照
2244+ ALTER TABLE iceberg_db .iceberg_table
2245+ EXECUTE publish_changes(" wap_id" = " test_wap_001" );
2246+ ```
2247+
2248+ ** 注意事项:**
2249+
2250+ 1 . 该操作不支持WHERE条件,也不支持分区(PARTITION/PARTITIONS)子句
2251+ 2 . 仅对启用了write.wap.enabled = true并通过wap.id产生 WAP 快照的 Iceberg 表有意义
2252+ 3 . 如果找不到与指定wap_id对应的快照,操作会失败并抛出错误
2253+ 4 . 发布后,新快照将成为当前快照
2254+ 5 . 如果在发布前表还没有任何快照,则previous_snapshot_id可能为 NULL
2255+
22132256## Iceberg 表优化
22142257
22152258### 查看数据文件分布
You can’t perform that action at this time.
0 commit comments