在 Snowflake Data Clean Rooms 中管理 Cross-Cloud Auto-Fulfillment

关于 Cross-Cloud Auto-Fulfillment

在默认的 Clean Room 环境中,Clean Room 只能与同一云区域中的账户共享。也就是说,提供商和使用者必须位于同一云区域中。

If you want to collaborate with a collaborator whose account is in a different region than your account, you must enable Cross-Cloud Auto-Fulfillment for your clean room environment and your clean room as shown on this page.

您可以通过运行 SELECT CURRENT_REGION(); 确定您自己的云区域

备注

Cross-Cloud Auto-Fulfillment 有时被称为 LAF,代表 列表自动履行

启用 Cross-Cloud Auto-Fulfillment

您可以使用 API 或 UI 启用 Cross-Cloud Auto-Fulfillment。但请注意 跨区域协作的局限性

先决条件

要为账户启用 Cross-Cloud Auto-Fulfillment,组织管理员必须先通过调用 SYSTEM$ENABLE_GLOBAL_DATA_SHARING_FOR_ACCOUNT 在账户上启用 Cross-Cloud Auto-Fulfillment。这既适用于提供商,也适用于使用者。

了解有关 自动履行管理自动履行权限 的更多信息。

在 UI 中启用 Cross-Cloud Auto-Fulfillment

Clean Room 管理员按照以下步骤在账户级别为所有新的和现有的 Clean Room 启用 Cross-Cloud Auto-Fulfillment:

  1. 使用您的管理员账户登录 Clean Room UI

  2. 浏览到 Admin > Snowflake Admin

  3. 开启 Cross-Cloud Auto-Fulfillment

  4. :emph:`在 UI 中创建或联接 Clean Room ` 时,提供商或使用者无需采取其他步骤。但是,如果您以后 :emph:`在 API 中创建或联接 Clean Room `,则必须遵循面向提供商和使用者的 API 说明。

在 API 中启用 Cross-Cloud Auto-Fulfillment

即使您已经在 UI 中启用了 Cross-Cloud Auto-Fulfillment,也可以按照这些说明在 API 中创建或安装 Clean Room。

账户管理员

要使用 API 为账户启用 Cross-Cloud Auto-Fulfillment,提供商和使用者账户中的管理员都必须使用 ACCOUNTADMIN 角色运行以下示例代码。对于每个账户,仅需运行一次。

USE ROLE ACCOUNTADMIN;
-- Optionally check first to see if cross-cloud is enabled on the account.
CALL samooha_by_snowflake_local_db.library.is_laf_enabled_on_account();

-- If not, enable it.
CALL samooha_by_snowflake_local_db.library.enable_laf_on_account();
Copy

提供商和使用者

为账户启用 Cross-Cloud Auto-Fulfillment 后,以下是在创建或安装 Clean Room 时启用 Cross-Cloud Auto-Fulfillment 的方法:

  1. 提供商 通过调用 provider.create_or_update_cleanroom_listing 以正常方式发布 Clean Room。

  2. 使用者 通过调用 consumer.install_cleanroom 安装 Clean Room。如果使用者与提供商位于不同的云区域,则 consumer.install_cleanroom 会失败并显示一条消息,提示正在安装 Cross-Cloud Auto-Fulfillment 副本。

  3. 使用者 继续调用 consumer.install_cleanroom 直至返回“成功”。安装只需几分钟时间。

此时,使用者可以使用基本的 Clean Room 功能。如果使用者需要有关客户端模板请求、提供商运行分析和提供商激活的支持,请执行以下额外步骤:

  1. The provider calls provider.mount_request_logs_for_all_consumers to enable communication from the consumer to the provider.

完整设置代码示例:

  1. 提供商: 提供商以标准方式创建、共享和发布 Clean Room。

    USE WAREHOUSE APP_WH;
    USE ROLE SAMOOHA_APP_ROLE;
    
    SET cleanroom_name = 'LAF example';
    SET consumer_locator = '<CONSUMER_LOCATOR>';
    SET consumer_account_name = '<CONSUMER_DATA_SHARING_ACCOUNT_ID>';
    
    CALL SAMOOHA_BY_SNOWFLAKE_LOCAL_DB.provider.cleanroom_init($cleanroom_name);
    
    CALL SAMOOHA_BY_SNOWFLAKE_LOCAL_DB.provider.set_default_release_directive(
      $cleanroom_name,
      'V1_0', '0');
    
    CALL SAMOOHA_BY_SNOWFLAKE_LOCAL_DB.provider.add_consumers(
      $cleanroom_name,
      $consumer_locator,
      $consumer_account_name);
    
    CALL SAMOOHA_BY_SNOWFLAKE_LOCAL_DB.provider.create_or_update_cleanroom_listing($cleanroom_name);
    
    Copy
  2. 使用者: 使用者安装 Clean Room。

    USE WAREHOUSE APP_WH;
    USE ROLE samooha_app_role;
    
    SET cleanroom_name = 'LAF example';
    SET provider_locator = '<PROVIDER_LOCATOR>';
    
    -- Initial call starts the process and returns a cross-cloud/region replication failure.
    -- Continue to call this procedure until it returns a success message.
    CALL SAMOOHA_BY_SNOWFLAKE_LOCAL_DB.consumer.install_cleanroom(
      $cleanroom_name,
      $provider_locator);
    
    -- Continue with standard clean room configuration and use.
    -- Consumer can run analyses, but requests to submit a template aren't
    -- supported until the provider calls ``provider.mount_request_logs_for_all_consumers``.
    ...
    
    Copy
  3. 提供商: 使用者安装 Clean Room 后,如果要在提供商与使用者之间启用基于请求的操作,则提供商必须挂载请求共享。基于请求的操作包括运行分析的提供商请求,以及向 Clean Room 添加模板的使用者请求。

    -- Call mount_request_logs_for_all_consumers until it reports success.
    provider.mount_request_logs_for_all_consumers($cleanroom_name);
    
    Copy

    此时可以使用完整的提供商/使用者功能。

跨区域账户的刷新频率

当提供者和使用者位于不同的云区域时,请求和数据会受制于复制频率设置。

Requests and data from provider to consumer

This includes all data and requests from the provider to the consumer, such as creating or updating a clean room, changing provider data, requests for permission (such as provider-run analyses), and approvals for requests (such as consumer templates).

You can change the provider to consumer refresh rate by calling set_laf_dcr_refresh_schedule.

数据

Default refresh rate

Provider clean room data, such as the following:

  • Provider datasets

  • Provider-run requests

  • Clean room policies

  • Provider clean room metadata

Requests and data from consumer to provider

The following table shows the default refresh frequency for data and requests from the consumer to the provider.

You can change the consumer to provider refresh rate.

数据

Default refresh rate

Requests, approvals, and changes such as the following:

  • 对提供商的请求(例如添加模板的请求)

  • 对提供商的批准(例如批准提供商运行的分析)

  • 对关联使用者数据的更改。

  • Clean rooms created after July 24, 2025: 10 minutes

  • Older clean rooms: 1 hour

Provider activation data:

  • Clean rooms created after July 24, 2025: 10 minutes

  • Older clean rooms: 15 minutes

与跨区域协作相关的成本

如果协作者在不同的区域,则需要支付额外费用。有关这些成本如何产生的更多信息,请参阅 自动履行成本

对跨区域协作的限制

跨区域协作存在以下限制:

  • 使用 Clean Room UI 时,协作者必须共享 同一个 UI 托管区域。例如,如果一个账户的 UI 托管区域是 Amazon Web Services:US 东部(弗吉尼亚北部),而另一个账户的 UI 托管区域是 Amazon Web Services:亚太地区(孟买),则这两个账户无法在 UI 中协作。但是,如果账户和 Clean Room 都针对 Cross-Cloud Auto-Fulfillment 进行了配置(如本页所述),则它们 可以 使用 API 进行协作。

  • 提供商不能在 Clean Room 中使用差分隐私。

  • 协作者无法在 Clean Room 中关联外部表和 Iceberg 表。

  • 使用者无法运行多提供商分析。

  • An account cannot act as both provider and consumer in cross-cloud collaboration scenarios due to replication type conflicts that can occur.

  • See additional considerations when enabling cross-region collaboration.

语言: 中文