协作规范

定义高级别协作。该规范定义了邀请哪些分析运行者,以及针对每个分析运行者,他们可以访问和运行哪些数据及模板。此处列出的任何模板或数据产品都必须先注册,然后才能包含在协作规范中。

所有者通过调用 INITIALIZE 提交此规范。

架构:

api_version: 2.0.0              # Required: Must be "2.0.0"
spec_type: collaboration        # Required: Must be "collaboration"
name: <collaboration_name>      # Required: Unique name (max 75 chars)
version: <version_string>       # Optional: Version identifier (max 20 chars)
description: <collaboration_description>  # Optional: Description (max 1,000 chars)
owner: <owner_alias>            # Required: Alias of owner

collaborator_identifier_aliases:  # Required: Map aliases to account identifiers
  <alias_1>: <account_identifier_1>  # One or more alias mappings...

analysis_runners:               # Required: Who can run analyses
  <analysis_runner_alias>:      # One or more analysis runner definitions...
    data_providers:             # Required: Data providers for this runner
      <provider_alias>:         # One or more provider definitions...
        data_offerings:         # Required: List of offerings (can be empty [])
          - id: <data_offering_id>  # Zero or more data offering IDs...
    templates:                  # Optional: Templates this runner can use
      - id: <template_id>       # One or more template IDs...
    activation_destinations:    # Optional: Where results can be sent
      snowflake_collaborators:  # Optional: Collaborators who can receive results
        - <collaborator_alias>  # One or more collaborator aliases...
api_version

The version of the Collaboration API used. Must be 2.0.0.

spec_type

Specification type identifier. Must be collaboration.

name: collaboration_name

User-friendly name for this collaboration. Must be unique in the creator’s account and follow Snowflake identifier rules (maximum 75 characters).

version (Optional)

A version identifier for this collaboration (maximum 20 characters). Must follow Snowflake identifier rules. A good format to use is YYYY_MM_DD_V#. For example: 2025_10_22_V1.

description: collaboration_description (Optional)

人类可读的协作描述(最多 1,000 个字符),供协作者阅读。

owner: owner_alias

Alias of the collaboration owner, as defined in collaborator_identifier_aliases.

collaborator_identifier_aliases

A mapping of collaborator aliases to their Data Sharing Account Identifiers. Only users listed here can participate in the collaboration. Use the aliases defined here to refer to all collaborators, rather than using their data sharing account identifier directly. Must be unique in this collaboration and follow Snowflake identifier rules (maximum 25 characters).

analysis_runners

描述谁可以在此协作中运行分析。每个分析运行者均由唯一的别名作为键。您必须允许至少一个账户在此协作中运行分析。

<analysis_runner_alias>

Alias of account that can run an analysis in this collaboration. Alias is defined in the collaborator_identifier_aliases list.

data_providers

Data providers whose data this analysis runner can access. Each provider is keyed by the alias that is defined in collaborator_identifier_aliases.

data_offerings

A list of data offerings from this data provider that the analysis runner can access, or an empty array [] as a placeholder so that data offerings can be added later. Each data offering is referenced by its ID, generated when the data provider calls REGISTER_DATA_OFFERING.

templates (Optional)

此分析运行者可以使用的模板。每个模板均通过其 ID 进行引用。您可以在初始规范中省略此项,并在创建协作后仍与此分析运行者共享模板。

activation_destinations (Optional)

定义分析结果的激活设置。

snowflake_collaborators (Optional)

List of collaborators who can receive activated analysis results. Use the alias from the collaborator_identifier_aliases list in this spec. All collaborators listed here must have the permissions described in Activate query results.

示例

api_version: 2.0.0
spec_type: collaboration
name: my_sample_collaboration
owner: Owner
collaborator_identifier_aliases:
  Owner: ENG.OWNER
  AnalysisRunner_1: ENG.CONSUMER_1
  DataProvider_1: ENG.PROVIDER_1
  DataProvider_2: ENG.PROVIDER_2
  AnalysisRunner_2: ENG.PROVIDER_3
analysis_runners:
  AnalysisRunner_1:
    data_providers:
      DataProvider_1:
        data_offerings:
        - id: DCR_PREPROD_CI_PROVIDER_ANY_NAME_ZUDFTMULHQ_iuDfn_v0
      DataProvider_2:
        data_offerings: []
    templates:
    - id: test_sca_three_party_template_JOaVG_v0
  AnalysisRunner_2:
    data_providers:
      DataProvider_2:
        data_offerings: []
    templates:
    - id: test_sca_three_party_template_JOaVG_v0