メインコンテンツまでスキップ

カタログの作成

この記事では、Unity Catalog でカタログを作成する方法について説明します。 カタログには スキーマ (データベース) が含まれ、スキーマにはテーブル、ビュー、ボリューム、モデル、および関数が含まれます。

カタログの詳細については、「 Databricks のカタログとは」を参照してください。

注記

フォーリンカタログ (外部データ・システム内のデータベースをミラーリングするUnity Catalogオブジェクト) の作成方法については、フォーリンカタログの作成を参照してください。フォーリンカタログの管理と操作も参照してください。

必要条件

カタログの種類に関係なくカタログを作成するには:

  • Databricks メタストア管理者であるか、メタストアに対する CREATE CATALOG 特権を持っている必要があります。
  • ノートブックを実行してカタログを作成するために使用するコンピュート リソースは、 Databricks Runtime 11.3 以降を使用し、Unity Catalog 準拠のアクセス モードを使用している必要があります。 「アクセスモード」を参照してください。SQLウェアハウスは常に Unity Catalogをサポートしています。

共有カタログ を作成するには:

標準カタログ を作成するには:

  • カタログのマネージドストレージ場所を指定する場合は、ターゲット外部場所に対するCREATE MANAGED STORAGE権限が必要です。
  • メタストア レベルのマネージドストレージが存在しない場合は、カタログのマネージドストレージの場所を指定する 必要があります

フォーリンカタログ を作成するには:

  • フォーリンカタログを作成するために使用する接続の所有者であるか、接続に対するCREATE FOREIGN CATALOG権限を持っている必要があります。
  • コンピュートは Databricks Runtime 13.1以上で使用する必要があります。 SQLウェアハウスは Pro または サーバレス である必要があります。

カタログを作成する

カタログを作成するには、Catalog Explorer、SQL コマンド、REST API、Databricks CLI、または Terraform を使用できます。 カタログを作成すると、 defaultinformation_schemaの 2 つのスキーマ (データベース) が自動的に作成されます。

  1. Log in to a workspace that is linked to the metastore.

  2. Click Catalog icon Catalog.

  3. Click Catalogs below Quick access.

  4. Click Create catalog.

  5. On the Create a new catalog dialog, enter a Catalog name and select the catalog Type that you want to create:

    • Standard catalog: a securable object that organizes data and AI assets that are managed by Unity Catalog. For all use cases except Lakehouse Federation and catalogs created from Delta Sharing shares.
    • Foreign catalog: a securable object that mirrors a database in an external data system using Lakehouse Federation. See Overview of Lakehouse Federation setup.
    • Shared catalog: a securable object that organizes data and other assets that are shared with you as a Delta Sharing share. Creating a catalog from a share makes those assets available for users in your workspace to read. See What is a share?.
  6. Depending on the catalog type, specify the following options:

    • For standard catalogs: It is optional but strongly recommended that you specify a managed Storage location. You must have the CREATE MANAGED STORAGE privilege on the target external location that you use as a managed storage location. See Specify a managed storage location in Unity Catalog.

      You can optionally specify a subpath of a defined external location. If you don’t have an external location defined, you can create one by clicking Create a new external location.

important

If your workspace does not have a metastore-level storage location, you must specify a managed storage location when you create a catalog.

  • For foreign catalogs: You must select a Connection, which is a securable object in Unity Catalog that specifies a path and credentials for accessing an external database system. See Overview of Lakehouse Federation setup.

    When you’ve selected the connection, enter the name of the Database or other Databricks Catalog that you want to mirror.

    Requirements differ depending on the data source:

    • MySQL uses a two-layer namespace and therefore does not require a database name.
    • For connections to a catalog in another Databricks workspace, enter the Databricks Catalog name instead of a database name.

    If you don’t have a connection defined, you can create one by clicking Create a new connection.

  • For shared catalogs: You must select a Provider and a Share. Once you have selected the provider, you can select one of the provider’s shares.

    If you aren’t sure which provider and share you want, you might find it easier to browse or search for providers and shares using the Catalog Explorer browser. See View providers and View shares that a provider has shared with you.

  1. Click Create.

  2. On the Catalog created! dialog, click View catalog to accept the catalog as automatically configured, or click Configure catalog (recommended) to configure catalog permissions, workspace bindings, and metadata.

    If you click View catalog, the catalog will be accessible to all workspaces attached to the metastore, and the BROWSE privilege will be granted to all account users. You can skip the rest of the steps in this procedure and proceed to adding schemas to the catalog. See Create schemas.

    You can return to the catalog details page in Catalog Explorer at any time to update the owner, tags, comments, workspace bindings, permissions, and schemas.

  3. On the Configure catalog > Workspaces page, specify the workspace that the catalog is bound to.

    By default, the catalog is shared with all workspaces attached to the current metastore. If the catalog will contain data that should be restricted to specific workspaces, clear the All workspace have access option and use the Assign to workspaces button to add those workspaces. The current workspace must be included.

    After you assign a workspace, you can optionally change its default Read & Write access level to Read Only: select the workspace from the list and click the Manage Access Level button.

    For more information, see Limit catalog access to specific workspaces.

  4. Click Next to assign Permissions for your catalog.

    All account users have the BROWSE privilege by default, giving them the ability to discover catalog metadata without having read access to the data.

    To grant a privilege to a user, group, or service principal, click Grant and follow the instructions in Unity Catalog privileges and securable objects.

  5. Click Next to add optional tag and comment Metadata.

    Tags are key-value pairs that you can use to organize and categorize catalogs to simplify search and discovery of your data assets. Values are optional. See Apply tags to Unity Catalog securable objects.

    A Comment is an open-ended field that is often used to provide a description to help users discover the data assets in the catalog. See Add comments to data and AI assets.

  6. Click Save.

  7. Add schemas and data objects to the catalog.

    See Create schemas.

You can use Catalog Explorer to update the owner, tags, comments, workspace bindings, and permissions any time after you have created the catalog.

詳細情報