.clear materialized-view data.clear materialized-view data

清除现有具体化视图的数据。Clears the data of an existing materialized view.

仅从视图的 materialized part 中清除数据。The data is cleared from the materialized part of the view only. 有关 materialized part 的更多详细信息,请参阅具体化视图的工作原理For more details about the materialized part, see how materialized views work. 清除具体化视图数据后,视图将继续处理自上次具体化以来引入的源表记录。After the materialized view data is cleared, the view will continue processing the source table records ingested since the last materialization time. 使用 .show materialized-view 命令获取最后一个具体化时间戳。Use the .show materialized-view command to get the last materialization timestamp.

此命令与删除和重新创建视图(没有 backfill)的区别在于,使用此命令可保留对具体化视图设置的所有策略。The difference between this command and dropping and recreating the view (with no backfill) is that using this command preserves all policies set on the materialized view.

需要数据库管理员权限或具体化视图的管理员角色。Requires Database Admin permissions, or an admin of the materialized view.

语法Syntax

.clear materialized-view MaterializedViewName data.clear materialized-view MaterializedViewName data

示例Example

.clear materialized-view UsersView data