动态表限制¶
本主题介绍动态表的一般限制和跨功能限制。
一般限制¶
使用动态表时存在以下一般限制:
单个账户最多可容纳 50,000 个动态表。
不能截断动态表中的数据。
不能创建临时动态表。
当您使用动态表 引入共享数据 时,查询不能从共享动态表或引用上游动态表的共享安全视图中选择。
不能在动态表中使用次要角色,因为动态表的刷新会充当其所有者角色。有关更多信息,请参阅 通过主要角色和次要角色进行授权。
您不能在动态表的定义中使用动态 SQL(例如,会话变量或匿名块的无绑定变量)。
在动态表定义中,从用户定义的表函数 (UDTF) 读取的 SELECT 块必须明确指定列,并且不能使用
*。如果动态表在输入表的 MAX_DATA_EXTENSION_TIME_IN_DAYS 时间段内未刷新,则可能会变得过时。过时后,必须重新创建它们才能恢复刷新。
在创建使用名为 DEFAULT 的仓库的动态表时,必须按照 双引号标识符要求,将名称放在双引号内。例如
CREATE DYNAMIC TABLE ... WAREHOUSE = "DEFAULT"。有关创建动态表的更多信息,请参阅 创建动态表。动态表不支持包含目录表、外部表、流和物化视图的源。
您无法创建从查询其他动态表的视图中读取数据的动态表。
您无法克隆动态 Iceberg 表。此外,克隆包含动态 Iceberg 表的数据库或架构不会将该表克隆到新位置。
You can't set the DATA_RETENTION_TIME_IN_DAYS object parameter to zero if your base table is a shared table.
Immutability constraints¶
The following limitations apply when you work with immutability constraints and backfilled data:
Currently, only regular and dynamic tables can be used for backfilling.
You can't specify policies or tags in the new dynamic table because they are copied from the backfill table.
Clustering keys in the new dynamic table and backfill table must be the same.
支持跨功能交互¶
不支持以下跨功能交互:
使用 Query Acceleration Service (QAS) 进行动态表刷新。
在共享表上使用数据库角色的掩码策略。
聚合和投影策略不能应用于动态表的基表。如果基表具有与之关联的聚合或投影策略,则动态表将无法创建。
对增量刷新的支持¶
Dynamic tables support two refresh modes: incremental and full. You can either set the refresh mode to AUTO or set it explicitly. For more information, see 动态表刷新模式 and 选择刷新模式.
掩码和行访问策略¶
Masking or row access policies on a dynamic table don't affect its refresh mode. However, policies applied on base tables might affect the refresh mode:
Incremental refresh is supported if the policies on base tables use the CURRENT_ROLE or IS_ROLE_IN_SESSION function.
Incremental refresh isn't supported if the policies on base tables use any other functions, INFORMATION_SCHEMA views, or query a table (for example, a mapping table lookup).
如果更改具有增量刷新的动态表的基础对象策略,会触发重新初始化。
复制¶
具有增量刷新的复制动态表在故障转移后重新初始化,然后才能恢复增量刷新。
有关更多信息,请参阅 复制和动态表。
克隆¶
克隆的增量动态表 在创建后第一次刷新期间可能需要重新初始化。
如果一个动态表是从另一个包含已删除基表的动态表克隆的,则克隆将被暂停,无法恢复或刷新。