Native Apps 中的声明式共享:限制¶
声明式共享是 Snowflake Native Apps 中的一项功能,它允许提供方通过简单的 YAML 配置文件,快速定义并在多个数据库间共享对象。虽然此功能显着简化了数据共享工作流程,但提供商在实施前应了解其限制。
支持的对象类型¶
声明式共享支持以下对象类型:
笔记本
Tables, including:
Dynamic tables
Apache Iceberg tables
Views, including:
Semantic views
Stored procedures
User-defined functions (UDFs)
Cortex Agents
Streams
在 Native Apps 的声明式共享中,其他类型的对象不支持共享。
笔记本限制¶
- Read-only for consumers
使用者无法就地编辑提供商笔记本,也无法克隆这些笔记本。
- Network access
在客户账户中运行时,笔记本无法访问外部端点或使用者数据。
- Specialized libraries
地理空间库和其他第三方库不能保证在笔记本中开箱即用。
- External dependencies
声明式共享应用程序对外部库(Snowflake Anaconda 通道和代码暂存区中的 Python 文件)的支持有限。
- Non-interactive execution
Notebooks that are part of native applications cannot be executed non-interactively by worksheets or SQL commands.
安全和访问控制¶
- Role definition
共享内容中引用的所有应用程序角色都必须在清单的
roles字段中预先定义。- Object-level roles
对象角色必须是其父架构角色的子集。
- Missing role validation
如果共享配置中引用的角色不存在,则验证清单将返回错误。
- Minimum privileges
提交
shared_content.yaml文件的提供商角色必须至少拥有授予使用者的共享对象的权限。- No REFERENCE_USAGE required
与传统的数据共享不同,提供商无需向应用程序包授予 REFERENCE_USAGE 权限。
迁移和兼容性¶
- Declarative Sharing migration
Migration support for switching from data shares to Declarative Sharing in the Native App framework is unavailable.
命名和配置约束¶
- No wildcards
必须显式指定对象名称;不支持通配符或正则表达式匹配。
- Name collision prevention
两个共享对象不能有相同的 DOMAIN 和名称。
- Schema mapping
不支持架构映射。不允许多个数据库中的架构名称重叠。
- Schemas for data objects and logic objects
You must use separate schemas for data objects (shared by reference: tables and views) and logic objects (shared by copy: UDFs, stored procedures, Cortex Agents). For example, you can use a schema named
DATA_SCHEMAfor tables and views, and a schema namedLOGIC_SCHEMAfor UDFs.
Monitoring¶
- Auditability
Declarative Native Apps don't provide monitoring resources (such as audit trails) to let the provider receive information from the consumer about how the shared data is being used. If a consumer has compliance or regulatory requirements that require auditing, the consumer must work with the provider to implement their own monitoring solutions.
Cortex Agents¶
- Execution Environment
When creating a Cortex Agent for sharing that uses Cortex Analyst and semantic views, you must explicitly define the
execution_environmentwith an empty string for the warehouse (warehouse: ""). You can't omit this field, nor can you specify a specific warehouse name.- Tools
All tools must be in the same database as the Agent. While procedures and UDFs are shared by copy and may be in the same schema as the Agent, semantic views and Cortex Search-based tools must be in a different schema.