Snowflake Data Clean Rooms の概要

This page provides an overview of how Snowflake Data Clean Rooms works. If you are a Snowflake administrator and want to install clean rooms in your account, read Snowflake Data Clean Rooms 環境のインストール.

Snowflake Data Clean Rooms の概要

データclean roomは構成可能であり、隔離されたSnowflake環境です。コラボレーターはここにデータをインポートし、そのデータに対して実行可能なクエリを指定したり、差分プライバシーの設定、結合や投影の可能行の指定などのデータ保護設定を行ったりできます。clean roomにアクセスするには招待が必要です。

Clean roomは収益化の機能をサポートしていません。プロバイダーのコストは、clean roomの有効化に必要なさまざまなバックグラウンドプロセスに対して請求され、クエリを実行するアカウントのコストは、データとコンピューティングの使用に対する標準的なSnowflakeコストに対して請求されます。コストについて詳しくは、 コストを理解する をご覧ください。

clean roomへのアクセスには、clean roomプロバイダーの招待が必要です。clean roomを多くのユーザーに公開したい場合は、コラボレーターになりたいユーザーからSnowflakeアカウント (Snowflakeユーザーではない場合はメールアドレス) を送ってもらうよう手配し、そのユーザーを招待する必要があります。

以降ではSnowflake Data Clean Roomsについて概要を説明します:

clean room環境のインストール

The Snowflake Data Clean Room environment is installed once for an entire Snowflake account (not once per user or per clean room) by someone with ACCOUNTADMIN privileges on the Snowflake account.

管理者は環境を構成する際に、clean roomの作成やクエリの実行を許可するユーザー、 API へのアクセスを許可するユーザー、clean roomへのコラボレーターの招待が許可されるアカウント、clean room作成者がclean roomにインポートできるデータ、このアカウントで作成されたclean roomからクエリ結果をエクスポートするために使用できるサードパーティサービス (もしあれば) を指定します。

お客様のアカウントにclean room環境がすでにインストールされている場合は、clean room管理者に問い合わせてアクセスを依頼してください。アカウントにclean room環境がインストールされていない場合は、 環境のインストール方法 をご覧ください。

環境のインストールと構成を行った後、clean room UI、 API、 またはその両方を使用する権限が、管理者によって他のSnowflakeユーザーに付与されます。

詳細

注釈

  • If you were emailed an invitation to join a clean room, you already have clean rooms installed in your Snowflake account. You can read the rest of this page to learn more about clean room usage, but you don't need to install anything, only to join the clean room.

  • アカウント管理者の方で、Snowflakeアカウントにclean room環境がインストールされていない場合は、 Snowflakeアカウントにclean room環境をインストールする方法 をご覧ください。

  • アカウント管理者でない方は、 アカウント管理者に Snowflake Data Clean Rooms がインストールされているかどうかを確認してください。インストールされていない場合は、インストールとアクセス許可の付与を依頼してください。その場合は、clean roomにアクセスするための権限を要求してください。

  • 開発者の方で、 API アクセスが必要な場合は、 clean room管理者に API へのアクセスを許可するよう 依頼してください。

clean roomの作成

A Snowflake account administrator grants permission to users in their Snowflake account to be able to create clean rooms. The account that creates a clean room is called a provider for that clean room. Providers can configure and share clean rooms with users in other Snowflake accounts (or even non-Snowflake users). When a clean room is shared with you, you are called a consumer for that clean room.

After creating a clean room, the provider links (imports) tables or views into it, specifies what queries can be run against their data, which columns in their data can be joined or appear in the results, and what can be done with the results.

The provider then invites consumers to join the clean room, link their own tables and views, and run one of the queries specified by the provider. Consumers must be pre-approved by a clean rooms administrator before they can be invited to a clean room.

詳細

clean roomへの参加

clean roomを作成および構成した後、プロバイダーは他のアカウントのユーザーに、clean roomへの招待を送信します。招待されたユーザーは、 コンシューマー または コラボレーター と呼ばれます。clean room UI を通して招待されたコンシューマーは、clean roomへの招待メールを受け取ります。Snowflakeユーザーがclean roomに招待されるには、clean room環境がインストールされている必要がありますが、 Snowflake以外のユーザー をclean roomに招待することもできます。clean roomの作成者がユーザーを招待するには、そのSnowflakeアカウントがclean room管理者によって許可リストに登録されている必要があります。

(clean room UI では、コンシューマーがclean roomの招待を受け入れることを、「参加する」とも「インストールする」とも言います。これは、clean roomが文字どおりコンシューマーのclean room環境にインストールされる必要があるからです)。

clean roomに参加した後、コンシューマーはclean roomのテンプレートに必要なデータをインポート (リンク) し、どの列に結合や投影を許可するかなど、データへのアクセス方法を指定し、テンプレート固有のフィルターやその他のパラメーターを入力して、テンプレートを実行します。コンシューマーは、必要に応じてテンプレートの繰り返し実行を指定できます。結果はブラウザで表示したり、ダウンロードしたりできます。プロバイダーがアクティベーションを有効にし、コンシューマーが承認した場合、コンシューマーは承認された場所 (自身のSnowflakeアカウント、またはプロバイダーが指定したサードパーティのアクティベーションコネクタ) に結果をエクスポートできます。

クリーンルームにインポートされたデータは、どちらの当事者(プロバイダーまたはコンシューマー)によっても直接クエリしたり表示したりすることはできませんが、クリーンルーム内のテンプレートを介してのみアクセスできます。テンプレートは、プロバイダーまたはコンシューマーによってクリーンルームにインストールされた SQL クエリです。クリーンルームで使用するには、相手側が権限を付与する必要があります。

また、それぞれの側でアクセスルールを設定し、どの列の結合、投影、またはエクスポートを許可するか、どのテンプレートの実行をclean roomで許可するかなどを各自のデータに設定します。それぞれの側からいつでもclean roomのデータを削除できます。

デフォルトでは、コンシューマーだけがクリーンルームでテンプレートを実行できますが、プロバイダーは、クリーンルームで指定されたテンプレートを実行する権限をコンシューマーに求めることができます。

詳細

Templates

Every clean room has one or more templates installed. A template is a JinjaSQL query that typically includes run-time parameters provided by the template runner. These parameters enable users to specify column or table names or WHERE clause filters. You cannot simply run arbitrary SQL queries in a clean room (unless a provider grants that ability); most clean room usage is limited to templates submitted by the provider or consumer and approved by the other party.

Snowflake provides a few stock templates for common use cases such as audience overlap and reach and frequency templates. You can also create custom templates to use in your clean room. Snowflake Data Clean Rooms supports any valid JinjaSQL template.

テンプレートはclean room UI またはコードで実行できます。テンプレートの結果は表示またはダウンロードすることや、あるいは アクティベーション がそのclean roomで許可されていれば、プロバイダー、コンシューマー、および承認されたサードパーティと共有することもできます。

詳細

Clean roomのバリエーション

最も一般的なclean roomでは、上記で説明したように、プロバイダーがデータをインポートし、そのデータに対して実行できる1つ以上の特定のクエリと、その結果の共有方法を指定する場所です。また、コンシューマーが自分のデータをインポートし、結合されたデータに対して許可されたクエリを実行することもできます。ただし、プロバイダーは標準的なclean roomにさまざまなバリエーションを加えることができます:

  • プロバイダーからコンシューマーデータに対して独自のクエリを実行できます。デフォルトでは、clean roomでクエリを実行できるのはコンシューマーだけです。clean roomが有効な場合、プロバイダーはコンシューマーに対して、clean room内で指定したクエリを実行する許可をリクエストできます。

  • クエリ結果を、クエリを実行してるユーザーのSnowflakeアカウント、またはSnowflakeが承認したサードパーティアカウント (Meta Ads ManagerやThe Trade Deskなど) にエクスポート (アクティベート) できます。clean room外にデータをエクスポートするには、クエリするデータを共有しているすべての関係者の承認が必ず必要です。

  • いずれかの当事者に、実行するクエリによって呼び出すことができる :doc:`カスタムPythonコードを含む </user-guide/cleanrooms/demo-flows/custom-code>`ことを許可します。このコードは通常、クエリの実行中にデータを何らかの方法でフィルターまたは操作します。ファイルの保存、データのエクスポート、その他のアクションの実行などの外部アクションは実行できません。

  • クエリから 他のclean roomのデータにアクセス できますが、アクセスされるすべてのclean roomのプロバイダーの承認が必要です。

  • 複数のクエリを連鎖させることができます。

プロバイダーとコンシューマーについて

Clean room collaborators are classified as either a provider or a consumer for a given clean room. A provider is the account that creates a clean room; a consumer is an account that is shared a clean room. You cannot invite someone in the same account where you created a clean room to act as a consumer for that clean room. All users in the same Snowflake account have the same clean room role (provider or consumer) for the same clean rooms in that account.

The provider and consumer roles apply at the Snowflake account level, not the individual user level. That is, if you create clean room cleanroom1 using Snowflake account ABC, then share cleanroom1 with account XYZ, all ABC users with access to cleanroom1 are providers, and all XYZ users with access to cleanroom1 are consumers.

プロバイダーであるかコンシューマーであるかは、Snowflakeのロールやその他の権限ではなく、常にclean roomを作成したのか、共有されたかによって決定します。

プロバイダーとコンシューマーのロールについて、以降で詳しく説明します。

Tip

コラボレーター という用語が、コンシューマーまたは特定のclean roomにアクセスできるユーザーという意味で使われることもあります。

プロバイダー

プロバイダー は、clean roomを作成したアカウントです。そのアカウントからclean roomにアクセスするユーザーは、そのclean roomのプロバイダーとみなされます。

プロバイダーは以下のclean roomアクションを行います:

  • clean roomを作成、共有、削除する

  • コンシューマーとしてclean roomの使用を許可する人を指定する (コンシューマーの招待)

  • clean roomにデータをインポートする

  • clean roomで実行可能なテンプレートを定義する

  • コンシューマーによるclean roomでのカスタムテンプレート実行を許可するかどうかの指定

  • clean roomを共有するコンシューマーの招待

  • clean roomで使用するテンプレートの指定、およびclean roomへのカスタムテンプレートの作成

  • コンシューマーデータへのクエリ実行 (コンシューマーが同意した場合)

  • 連鎖テンプレートの許可

  • Pythonスクリプトをclean roomに読み込み、テンプレートで使用する

  • このclean roomのプロバイダーデータが、コンシューマークエリで指定された他のclean roomのデータでクエリされることを許可する

  • clean roomまたはコンシューマーの差分プライバシーを有効化または無効化する

  • clean roomのバージョンを管理する

  • 自分のデータに列および結合ポリシーを設定する

コンシューマー

コンシューマー は、プロバイダーからのclean roomへの参加 (インストール) の招待を受けて拡張されたアカウントです。

コンシューマーは以下のclean roomアクションを (clean room構成に従って) 実行します:

  • アカウントのclean roomに参加 (インストール) する

  • データをclean roomにインポートする

  • clean roomがサポートするクエリを実行する

  • clean roomで許可された場合にクエリ結果をエクスポートする

  • clean roomで自分のテンプレートを使用する権限をリクエストする

  • プロバイダーによるclean roomでのテンプレート実行を許可するかどうかを指定する (デフォルトでは、コンシューマーだけがテンプレートを実行できます)

  • clean roomのプロバイダーからコンシューマーのデータに対するクエリ実行を許可する

  • 複数のclean roomから、自分とプロバイダーのデータを参照するクエリを実行する (すべてのclean roomのプロバイダーが同意した場合)

  • clean roomにPythonスクリプトを読み込む (プロバイダーから権限を得た場合)

  • 自分のデータに列および結合ポリシーを設定する

  • プロバイダーが実行するクエリの差分プライバシーを設定する

Ways to access Snowflake Data Clean Rooms

Snowflake Data Clean Rooms provide both a no-code browser-based application (the clean rooms UI) and an API to create and manage clean rooms. Currently the clean rooms UI and API are not exactly equivalent in capabilities. Here is a summary of the differences:

UIのみの機能

APIのみの機能

  • clean roomのロゴ、名前、説明、使用可能なアクティベーションやIDコネクタのリストなどの環境管理タスク。

  • 管理者、プロバイダー、(潜在的な) コンシューマーアカウントのリストの管理。

  • テンプレートの繰り返し実行のスケジュール設定。(CRONジョブなどの他のスクリプトツールを使用したスケジュール設定もできます)。

  • ID プロバイダーの使用。

  • プロバイダーまたはコンシューマーのカスタムテンプレートの作成

  • テンプレート連鎖の作成

  • マルチプロバイダー分析

  • テーブルおよびテンプレートに対するコンシューマーレベルのアクセス制御(restrict_table_options_to_consumers および restrict_template_options_to_consumers)。

Note that you can create a clean room using the clean rooms UI and then use or manage it in the API, and vice versa.

Clean room UI

Snowflake Data Clean Roomは、ブラウザで管理および実行できます。clean room UI を使用し、プロバイダーまたはコンシューマーとしてclean roomを作成、管理、使用したり、管理アカウント、サードパーティコネクタ、 UI ユーザー向け機能など、さまざまなアカウントレベルの機能を構成したりできます。

The clean rooms UI is accessed at a separate URL from Snowsight. You can find the login URL here.

Permissions and access: You must be granted access to use the clean room UI by a clean room administrator. The clean rooms UI uses your Snowflake credentials.

Try out the clean rooms UI tutorial or read more about the clean rooms UI.

API

Snowflake provides a number of stored procedures to create, manage, and run clean rooms. These procedures can be called through Snowsight notebooks or worksheets or any interface where you can run stored procedures in your Snowflake account. The API does not enable clean room account administration; to administer a clean room account you must use the clean rooms UI.

Permissions and access: In order to use the API you must be granted access to use the SAMOOHA_APP_ROLE by the a clean rooms administrator for your Snowflake account.

clean room API の説明をご覧になるか、 または API チュートリアル をお試しください。

Snowflakeアカウントにclean room環境がインストールされていない場合

以降では、clean room UI または API がアカウントにインストールされているかどうかを確認する方法を説明します:

Snowflake Data Clean Roomsがインストールされているかどうかを確認するには:

  1. Snowsight にサインインします。

  2. ナビゲーションメニューで Catalog » Apps » Installed Apps を選択します。

  3. Look to see whether Snowflake Data Clean Rooms appears in your Installed Apps list.