Activating query results

激活概述

提供商或使用者可以通过名为 激活 的流程将模板结果发送到 Clean Room 外。Snowflake 支持三种类型的激活:

  • 提供商激活,结果将推送到提供商的 Snowflake 账户中的表中。

  • 使用者激活,结果将推送到使用者的 Snowflake 账户中的表中。

  • 第三方激活,即提供商或使用者通过 激活连接器 将结果推送给 Snowflake 批准的第三方,例如 LiveRamp 或 Meta Ads Manager。

In all cases, the template must support activation, and parties should approve activation for any columns of their own data that will be activated. Data providers specify which columns of their data are activated by setting an activation policy. For more about clean room policies see 了解 Clean Room 表策略.

激活支持差分隐私(如果启用),并遵守差分隐私规则和预算。

重要

如果使用者和提供商位于不同的云区域,则需要在两个账户和两个 Clean Room 中启用 Cross-Cloud Auto-Fulfillment

提供商和使用者激活

您可以配置 Clean Room 以将模板结果保存在提供商或使用者的 Snowflake 账户中。提供商和使用者都必须批准激活 Clean Room 外的任何数据。

Activation is implemented using a dedicated activation template. In the clean rooms UI, an activation template can be associated with an analysis template, and the user can run the analysis template, view the results, then run the associated activation template. The Snowflake-provided Audience Overlap & Segmentation flow does this.

An activation template need not be identical to any associated analysis template. The activation template is often a subset of the analysis template.

支持的模板

以下模板支持提供商和使用者激活:

支持的组合

Activation can be run either by the provider or the consumer. (Learn more about provider-run analyses.)

支持以下组合:

提供商激活

使用者激活

第三方激活

提供商运行

UI only

使用者运行

UI only

结果

提供商激活结果 将保存到提供商的账户 SAMOOHA_BY_SNOWFLAKE_LOCAL_DB.PUBLIC.PROVIDER_ACTIVATION_SUMMARY 表中。

使用者激活结果 将保存到 SAMOOHA_BY_SNOWFLAKE_LOCAL_DB.PUBLIC.CONSUMER_DIRECT_ACTIVATION_SUMMARY 表中的使用者账户中。

请参阅 查看结果 以了解如何读取数据。

实施提供商或使用者激活

设置

1.创建或联接 Clean Room

创建或联接 Clean Room 时,在 Activation Settings 下的 Configure Analysis & Query 步骤中,指定应将哪些列添加到激活到您账户的结果中。

2.运行模板并激活结果

要运行与分析相关的激活,请完成以下步骤:

  1. 运行分析。

  2. After running an analysis, select Results » Activate.

  3. Activation Hub 下,选择要激活到的提供商或使用者账户的名称。

  4. 提供特定于激活模板的信息,例如提供描述性分段名称或选择激活列。

  5. Provide a segment name: this is an arbitrary string used to identify a set of results from a given run. You can provide a different string for each activation to group each run's results separately, or you can use the same segment name over multiple runs if you want to combine results.

  6. 选择 Push Data

  7. To learn how to view activated results, see 查看提供商和使用者激活结果.

查看提供商和使用者激活结果

激活结果的位置和格式

All activation results are appended to a clean room designated table in the provider's or consumer's account. Each row in the table maps to a row in the query result. Results from each run are appended to the table (the table is not cleared before each run). You can distinguish between different runs by the ACTIVATION_ID column, which is unique per activation, or the SEGMENT column, which can be specified by the caller for each activation run.

备注

Provider activation results are written in encrypted format to a temporary table in the consumer's localDB. The results are then copied over to the provider's account and decrypted before saving. This extra move and decryption step can cause delays with large result sets.

  • 提供商激活结果 存储在提供商账户的 SAMOOHA_BY_SNOWFLAKE_LOCAL_DB.PUBLIC.PROVIDER_ACTIVATION_SUMMARY 中。

  • 使用者激活结果 存储在使用者账户的 SAMOOHA_BY_SNOWFLAKE_LOCAL_DB.PUBLIC.CONSUMER_DIRECT_ACTIVATION_SUMMARY 中。

这些表包含以下列:

USER_ID:

一行 JSON 格式的结果,其中,密钥是列名称,值是该行中该列的值。该对象还包含传递到模板的每个实参的列。

ACTIVATION_ID:

每个请求的 ID 都是唯一的。成功的激活请求将返回 ID。您可以按此列进行筛选以获得同一次激活运行的所有结果,或者如果在多次运行中重复使用相同的区段名称,则按 SEGMENT 进行筛选。这与 submit_analysis_requestrun_activation 返回的查询请求 ID 相同。

CLEANROOM_NAME:

在其中运行查询的 Clean Room 的名称。

CONSUMER:

仅限提供商激活)批准此激活的使用者。

PROVIDER:

仅限使用者激活)批准此激活的提供商。

SEGMENT:

运行激活时分配的任意字符串值。您可以使用此列联接多次查询运行的结果。

TIMESTAMP:

运行激活的时间。

提供商激活示例

SELECT * FROM SAMOOHA_BY_SNOWFLAKE_LOCAL_DB.PUBLIC.PROVIDER_ACTIVATION_SUMMARY WHERE segment = 'my_segment';

                             USER_ID                          |   CLEANROOM_NAME |   SEGMENT  | CONSUMER |          TIMESTAMP      |  ACTIVATION_ID
"{""AGE_BAND"":55,""ITEM_COUNT"":2328,""STATUS"":""MEMBER""}" |  test activation | my_segment | ABC1234  | 2025-04-01 16:27:14.068 | cleanroomactivationdataanalysisresults20250401231728469
"{""AGE_BAND"":20,""ITEM_COUNT"":88,""STATUS"":""PLATINUM""}" |  test activation | my_segment | ABC1234  | 2025-04-01 16:27:14.068 | cleanroomactivationdataanalysisresults20250401231728469
"{""AGE_BAND"":80,""ITEM_COUNT"":18,""STATUS"":""GOLD""}"     |  test activation | my_segment | ABC1234  | 2025-04-01 16:27:14.068 | cleanroomactivationdataanalysisresults20250401231728469
...

读取提供商或使用者激活结果

运行相应的 SQL 命令以查看激活到您的 Snowflake 账户的结果:

查看提供商激活结果

SELECT *
   FROM SAMOOHA_BY_SNOWFLAKE_LOCAL_DB.PUBLIC.PROVIDER_ACTIVATION_SUMMARY
   [WHERE segment = <SEGMENT_NAME>] [AND activation_id = <ACTIVATION_ID>];
Copy

查看使用者激活结果

SELECT *
   FROM SAMOOHA_BY_SNOWFLAKE_LOCAL_DB.PUBLIC.CONSUMER_DIRECT_ACTIVATION_SUMMARY
   [WHERE segment = <SEGMENT_NAME>] [AND activation_id = <ACTIVATION_ID>];
Copy

每行数据都组合成 USER_ID 列中的一个对象。您可以使用如下查询来展平结果:

-- Assuming columns AGE_BAND, STATUS, and ITEM_COUNT
SELECT
  item:"AGE_BAND",
  item:"STATUS",
  item:"ITEM_COUNT"
FROM (SELECT parse_json(user_id)
      AS item
      FROM SAMOOHA_BY_SNOWFLAKE_LOCAL_DB.PUBLIC.PROVIDER_ACTIVATION_SUMMARY
      WHERE segment = $segment_name)
ORDER BY item:"AGE_BAND", item:"STATUS" ASC
LIMIT 20 ;
Copy

在 Snowsight 中查看最新 10 行结果:

  1. Sign in to Snowsight.

  2. In the navigation menu, select Catalog » Database Explorer.

    • For provider activation navigate to SAMOOHA_BY_SNOWFLAKE_LOCAL_DB » PUBLIC » Tables » PROVIDER_ACTIVATION_SUMMARY.

    • For consumer activation navigate to SAMOOHA_BY_SNOWFLAKE_LOCAL_DB » PUBLIC » Tables » CONSUMER_DIRECT_ACTIVATION_SUMMARY.

  3. 选择 Data Preview

第三方激活

第三方激活存款查询会导致 Snowflake 批准的第三方的账户使用 第三方激活连接器

仅 Clean Room UI 支持第三方激活,不支持使用自定义模板。

仅当 Clean Room 账户 允许激活 时支持在使用 Clean Room UI 时激活。

Clean Room 管理员必须将环境配置为支持第三方激活连接器,选择允许的连接器并对其进行配置,然后才能在任何 Clean Room 中使用它们。

第三方激活支持使用者和提供商运行的分析。

支持的模板

以下模板支持第三方激活:

  • Audience Overlap & Segmentation

实施第三方激活

  1. 创建或联接 Clean Room: 创建或联接 Clean Room 时,在 Activation Settings 下的 Configure Analysis & Query 步骤中,指定应将哪些列添加到激活到您账户的结果中。

  2. 激活结果:

    1. 运行分析。

    2. After running an analysis, select Results » Activate.

    3. Activation Hub 下,选择要激活到的第三方提供商的名称。

    4. 提供特定于提供商的信息。这可以提供描述性名称或选择要激活的列。页面上的工具提示应为该提供商提供更多信息。

    5. 选择 Push Data

语言: 中文