文档首页/ MapReduce服务 MRS/ 组件操作指南(LTS版)/ 使用Iceberg(MRS 3.6.0.1及之后版本)/ 基于Spark使用Iceberg/ Iceberg CALL COMMAND语法说明/ set_current_snapshot
更新时间:2026-06-11 GMT+08:00
set_current_snapshot
基本语法
可使用set_current_snapshot设置表的当前快照ID。与回滚不同,该操作不要求目标快照必须是表当前状态的祖先快照。例如:
将db.sample表的当前快照设置为ID为1的快照:
CALL prod.system.set_current_snapshot('db.sample', 1); 将db.sample表的当前快照设置为标签s1对应的快照:
CALL prod.system.set_current_snapshot(table => 'db.sample', ref => 's1');
其中,表名字段的类型为string,快照ID字段的类型为long,“ref”为设置当前快照的快照引用(分支或标签),类型为string。且必须设置快照ID或ref,二者不可同时提供,也不可均不提供。
输出结果介绍请参见表1。