Dataplex Universal Catalog でリソースを検索する

このドキュメントでは、Dataplex Universal Catalog を使用して、BigQuery データセット、Cloud SQL インスタンス、その他のサポートされているソースなどのリソースを検索する方法について説明します。分散データソースを一元的に配置することで、企業データのカタログ作成、分類、アクセス制御、ガバナンスを行うことができます。

Dataplex Universal Catalog には、次の 2 つの検索モードがあります。

  • キーワード検索では、特定のキーワード、フィルタ、定義された構文を使用してリソースを検索できます。
  • 自然言語検索は、AI を活用してセマンティック クエリをサポートします。普段使う言葉でリソースを検索できます。複雑な構文を使用する必要はありません。

検索範囲

Dataplex Universal Catalog の検索結果には、ソースシステム内の対応するリソースに対する権限が適用されます。

たとえば、オブジェクトに対する BigQuery メタデータの読み取りアクセス権を持っている場合、そのオブジェクトは Dataplex Universal Catalog の検索結果に表示されます。BigQuery テーブルへのアクセス権はあるものの、そのテーブルを含むデータセットへのアクセス権がない場合、依然としてテーブルは Dataplex Universal Catalog の検索で想定どおりに表示されます。

デフォルトでは、検索の範囲は組織に限定されています。検索結果には、検索対象のプロジェクトと同じ組織のリソースのみが含まれます。

検索結果には、検索が実行されるプロジェクトと同じ VPC-SC 境界に属するリソースのみが表示されます。Google Cloud コンソールを使用する場合、これはコンソールで選択したプロジェクトです。

プロジェクトの VPC Service Controls 境界内のリソースを超えて検索結果の範囲を広げるには、VPC Service Controls の上り(内向き)と下り(外向き)のルールを使用します。これらのルールにより、組織全体で限定公開かつ効率的なデータ交換が可能になります。上り(内向き)ルールと下り(外向き)ルールは、Google Cloud コンソール、JSON ファイル、YAML ファイルのいずれかを使用して構成できます。次の YAML の例と VPC Service Controls のドキュメントを参照して、ルールを特定の要件に合わせて調整します。

egressPolicies:
  - egressFrom:
      identityType: ANY_USER_ACCOUNT
    egressTo:
      # Specify which resources should be present in the search results. In this example,
      # BigQuery.
      operations:
      - methodSelectors:
        - method: '*'
        serviceName: bigquery.googleapis.com
      # Specify project ids under which the search is performed.
      resources:
      - projects/SEARCH_PROJECT_ID
ingressPolicies:
  - ingressFrom:
      identityType: ANY_USER_ACCOUNT
      sources:
      - accessLevel: '*'
    ingressTo:
      # Specify which resources should be present in the search results. In this example,
      # BigQuery.
      operations:
      - methodSelectors:
        - method: '*'
        serviceName: bigquery.googleapis.com
      # Specify project ids to expose in search results.
      resources:
      - projects/INGRESS_PROJECT_ID

Dataplex Universal Catalog 検索に必要な Identity and Access Management ロールの詳細については、Dataplex Universal Catalog IAM ロールをご覧ください。

VPC Service Controls を使用して環境ごとに検索結果を分離する

開発環境、テスト環境、本番環境などの環境間で Dataplex Universal Catalog の検索結果を分離するには、各環境に個別の VPC Service Controls 境界を構成します。データアセットを含むプロジェクトと、検索の実行に使用されるプロジェクトの両方を、対応する環境の境界に割り当てます。特定の境界内のプロジェクトから実行された検索では、同じ境界内にあるアセットの結果のみが返されます。

検索での再現率の上限

Dataplex Universal Catalog の検索クエリは、完全な再現率を保証するものではありません。クエリに一致する結果が返されない場合があります。また、検索クエリを繰り返すと、返される結果(または返されない結果)が変わることがあります。

Dataplex Universal Catalog のメタデータをすべてクエリするには、メタデータを Cloud Storage にエクスポートしてから、BigQuery からクエリします。詳細については、メタデータをエクスポートするをご覧ください。

フィルタ

フィルタを使用すると、検索結果を絞り込むことができます。フィルタはキーワード検索と自然言語検索の両方で使用できますが、モードによって使用できるオプションが若干異なる場合があります。

複数のセクションでフィルタを指定すると、フィルタは AND 論理演算子を使用して評価されます。検索結果には、選択したすべてのセクションで 1 つ以上の条件に一致するリソースが含まれます。たとえば、BigQuery システムとデータセット リソースタイプを選択した場合、検索結果には BigQuery データセットが含まれますが、Vertex AI データセットは含まれません。

1 つのセクションで複数のフィルタを選択すると、それらは OR 論理演算子を使用して評価されます。たとえば、データセット リソースタイプとテーブル リソースタイプを選択すると、検索結果にはデータセットとテーブルの両方が含まれます。

キーワード検索フィルタ

キーワード検索の場合、フィルタは次のセクションにグループ化されます。

  • [システム](BigQuery、Cloud SQL など)。Dataplex Universal Catalog システムにはカスタム エントリが含まれています。
  • [アスペクト(タグ)] には、使用可能なすべてのアスペクトが一覧表示されます。
  • [プロジェクト] には、使用可能なすべてのプロジェクトが一覧表示されます。
  • [タイプ エイリアス] には、データベース、データセット、モデル、テーブル、ビュー、サービス、カスタムタイプなどのリソースタイプが記述されます。
  • [データセット] の値は BigQuery から取得されます。

アスペクト値でフィルタする

[アスペクト] フィルタを使用することで、特定のテンプレートを使用してタグ付けされたアセットにクエリを実行できます。[カスタマイズ] メニューを使用することで、結果をさらに絞り込んだり、特定のアスペクト値でフィルタしたりできます。アスペクト値のフィルタ条件は、そのアスペクト フィールドのデータ型によって異なります。たとえば、datetime フィールドと number フィールドには、特定の日付または範囲を指定できます。

フィルタの可視性

[検索] フィールドの現在のクエリに応じて、[システム]、[タイプ エイリアス]、[プロジェクト]、[データセット] のフィルタが表示されます。

自然言語検索フィルタ

自然言語検索では、次のフィルタを使用できます。

  • スコープ: 組織全体(デフォルト)、現在のプロジェクト、またはスター付きリソースのみを検索します。詳細については、このドキュメントの検索範囲のセクションをご覧ください。
  • システム: リソースが属する Google Cloud サービス(BigQuery など)。Dataplex Universal Catalog システムにはエントリ グループが含まれています。
  • プロジェクト: 検索するプロジェクト。
  • タイプ: リソースタイプ(BigQuery 接続、Cloud Storage バケット、データベースなど)。リソースタイプによっては、接続タイプや SQL 言語などのサブタイプでフィルタすることもできます。
  • ロケーションの選択: 検索するロケーション。
  • データセットを選択します: 検索結果は、選択した BigQuery データセットに属する BigQuery リソースに制限されます。[フィルタ テキストを入力] フィールドに、データセットの名前を入力します。
  • アスペクト タイプ: 検索対象のリソースに関連付けられている Dataplex Universal Catalog のアスペクト タイプ。アスペクト値でフィルタするには、[アノテーション値でフィルタ] をクリックし、値を選択します。

始める前に

検索を実行する前に、必要なロールが付与され、必要な API が有効になっていることを確認してください。

必要なロール

このセクションでは、リソースの検索と検索結果へのアクセスに必要なロールと権限について説明します。

ロールの付与の詳細については、アクセスの管理をご覧ください。

必要な権限は、カスタムロールや他の事前定義ロールから取得することもできます。

エントリの検索に必要なロール

エントリを検索するには、検索に使用されるプロジェクトで、Dataplex Catalog 管理者、Dataplex Catalog 編集者、または Dataplex Catalog 閲覧者のいずれかの IAM ロールが必要です。検索結果に対する権限は、選択したプロジェクトとは別にチェックされます。

検索結果にアクセスするために必要なロール

Dataplex Universal Catalog の検索結果は、ロールに応じてスコープが設定されます。Dataplex Universal Catalog でアセットを検索するには、ソースシステム内の対応するリソースにアクセスする権限が必要です。詳細については、このドキュメントの検索範囲をご覧ください。

たとえば、BigQuery のデータセット、テーブル、ビュー、モデルを検索するには、それらのエントリに対するそれぞれの権限が必要です。詳細については、BigQuery の権限をご覧ください。

次のリストに、最低限必要な権限を示します。

  • テーブルを検索するには、そのテーブルに対する bigquery.tables.get 権限が必要です。
  • データセットを検索するには、そのデータセットに対する bigquery.datasets.get 権限が必要です。
  • データセットまたはテーブルのメタデータを検索するには、BigQuery メタデータ閲覧者のロール(roles/bigquery.metadataViewer)が必要です。

別の例として、Cloud SQL インスタンス、データベース、スキーマ、テーブル、ビューを検索するには、それらのエントリに対するそれぞれの権限が必要です。詳細については、Cloud SQL のロールと権限をご覧ください。

カスタム エントリを検索するには、Dataplex Catalog 閲覧者のロール(roles/dataplex.catalogViewer)が必要です。

API を有効にする

Enable the Dataplex API.

Roles required to enable APIs

To enable APIs, you need the Service Usage Admin IAM role (roles/serviceusage.serviceUsageAdmin), which contains the serviceusage.services.enable permission. Learn how to grant roles.

Enable the API

リソースを検索

コンソール

リソースを検索する手順は次のとおりです。

  1. Google Cloud コンソールで、Dataplex Universal Catalog の [検索] ページに移動します。

    検索に移動

  2. [検索プラットフォームの選択] で、[Dataplex Universal Catalog] を選択します。

    [Dataplex Universal Catalog] を選択すると、Dataplex Universal Catalog のメタデータ ストレージを検索できます。既存の Data Catalog ユーザーの場合は、[Data Catalog] を選択すると、Data Catalog リポジトリを検索できます。

  3. キーワード検索を使用する手順は次のとおりです。

    1. [プロジェクト全体でリソースを検索] フィールドにクエリを入力します。

    2. 検索を絞り込むには、[フィルタ] パネルを使用します。使用可能なフィルタのリストについては、キーワード検索フィルタをご覧ください。

      次のフィルタを手動で追加できます。

      • プロジェクト フィルタを追加する: [プロジェクト] で、[プロジェクトを追加] をクリックします。特定のプロジェクトを検索して選択し、[開く] をクリックします。
      • アスペクト タイプ フィルタを追加する: [アスペクト] で、[アスペクト タイプを追加] メニューをクリックします。特定のテンプレートを検索して選択し、[OK] をクリックします。
    3. 省略可: 使用可能なアセットだけでなく、[公開データセットを含める] を選択することで、 Google Cloud で一般公開されているリソースを検索できます。

      検索クエリを作成するには、次のヒントを参考にしてください。

      • スペースが含まれている場合は、検索式を引用符で囲みます。例: "search terms"
      • キーワードの前に NOT を付けると、keyword:term フィルタの論理否定に一致します。ANDOR のブール演算子を使用して検索式を結合することもできます。ANDORNOT 演算子の大文字と小文字は区別されません。

      たとえば、NOT column:term は、指定された用語に一致するものを除くすべての列を一覧表示します。Dataplex Universal Catalog の検索式で使用できるキーワードとその他の用語のリストについては、検索構文をご覧ください。

  4. 自然言語検索を使用する手順は次のとおりです。

    1. [自然言語検索を試す] をクリックします。

    2. [Find resources across projects with natural language] フィールドに自然言語でクエリを入力し、Enter キーを押します。

      次のクエリはサンプルです。

      • Show me the datasets that contain taxi information
      • Find data on vaccine distribution across different countries
      • Get tables with historical temperature data for major world cities
      • Search for hurricane tracking and storm activity datasets
      • Population data by country
    3. 検索を絞り込むには、[フィルタ] をクリックします。使用可能なフィルタのリストについては、自然言語検索フィルタをご覧ください。

  5. 検索したリソースの詳細を表示するには、検索結果でリソース名をクリックします。エントリの詳細ページが開きます。

gcloud

リソースを検索するには、gcloud dataplex entries search コマンドを使用します。

C#

C#

このサンプルを試す前に、クライアント ライブラリを使用した Dataplex Universal Catalog のクイックスタートにある C# の設定手順を完了してください。詳細については、Dataplex Universal Catalog C# API のリファレンス ドキュメントをご覧ください。

Dataplex Universal Catalog で認証を行うには、アプリケーションのデフォルト認証情報を設定します。詳細については、ローカル開発環境の認証の設定をご覧ください。

using Google.Api.Gax;
using Google.Api.Gax.ResourceNames;
using Google.Cloud.Dataplex.V1;
using System;

public sealed partial class GeneratedCatalogServiceClientSnippets
{
    /// <summary>Snippet for SearchEntries</summary>
    /// <remarks>
    /// This snippet has been automatically generated and should be regarded as a code template only.
    /// It will require modifications to work:
    /// - It may require correct/in-range values for request initialization.
    /// - It may require specifying regional endpoints when creating the service client as shown in
    ///   https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
    /// </remarks>
    public void SearchEntriesRequestObject()
    {
        // Create client
        CatalogServiceClient catalogServiceClient = CatalogServiceClient.Create();
        // Initialize request argument(s)
        SearchEntriesRequest request = new SearchEntriesRequest
        {
            LocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
            Query = "",
            OrderBy = "",
            Scope = "",
            SemanticSearch = false,
        };
        // Make the request
        PagedEnumerable<SearchEntriesResponse, SearchEntriesResult> response = catalogServiceClient.SearchEntries(request);

        // Iterate over all response items, lazily performing RPCs as required
        foreach (SearchEntriesResult item in response)
        {
            // Do something with each item
            Console.WriteLine(item);
        }

        // Or iterate over pages (of server-defined size), performing one RPC per page
        foreach (SearchEntriesResponse page in response.AsRawResponses())
        {
            // Do something with each page of items
            Console.WriteLine("A page of results:");
            foreach (SearchEntriesResult item in page)
            {
                // Do something with each item
                Console.WriteLine(item);
            }
        }

        // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
        int pageSize = 10;
        Page<SearchEntriesResult> singlePage = response.ReadPage(pageSize);
        // Do something with the page of items
        Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
        foreach (SearchEntriesResult item in singlePage)
        {
            // Do something with each item
            Console.WriteLine(item);
        }
        // Store the pageToken, for when the next page is required.
        string nextPageToken = singlePage.NextPageToken;
    }
}

Go

Go

このサンプルを試す前に、クライアント ライブラリを使用した Dataplex Universal Catalog のクイックスタートにある Go の設定手順を完了してください。詳細については、Dataplex Universal Catalog Go API のリファレンス ドキュメントをご覧ください。

Dataplex Universal Catalog で認証を行うには、アプリケーションのデフォルト認証情報を設定します。詳細については、ローカル開発環境の認証の設定をご覧ください。


package main

import (
	"context"

	dataplex "cloud.google.com/go/dataplex/apiv1"
	dataplexpb "cloud.google.com/go/dataplex/apiv1/dataplexpb"
	"google.golang.org/api/iterator"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := dataplex.NewCatalogClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &dataplexpb.SearchEntriesRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/dataplex/apiv1/dataplexpb#SearchEntriesRequest.
	}
	it := c.SearchEntries(ctx, req)
	for {
		resp, err := it.Next()
		if err == iterator.Done {
			break
		}
		if err != nil {
			// TODO: Handle error.
		}
		// TODO: Use resp.
		_ = resp

		// If you need to access the underlying RPC response,
		// you can do so by casting the `Response` as below.
		// Otherwise, remove this line. Only populated after
		// first call to Next(). Not safe for concurrent access.
		_ = it.Response.(*dataplexpb.SearchEntriesResponse)
	}
}

Java

Java

このサンプルを試す前に、クライアント ライブラリを使用した Dataplex Universal Catalog のクイックスタートにある Java の設定手順を完了してください。詳細については、Dataplex Universal Catalog Java API のリファレンス ドキュメントをご覧ください。

Dataplex Universal Catalog で認証を行うには、アプリケーションのデフォルト認証情報を設定します。詳細については、ローカル開発環境の認証の設定をご覧ください。

import com.google.cloud.dataplex.v1.CatalogServiceClient;
import com.google.cloud.dataplex.v1.LocationName;
import com.google.cloud.dataplex.v1.SearchEntriesRequest;
import com.google.cloud.dataplex.v1.SearchEntriesResult;

public class SyncSearchEntries {

  public static void main(String[] args) throws Exception {
    syncSearchEntries();
  }

  public static void syncSearchEntries() throws Exception {
    // This snippet has been automatically generated and should be regarded as a code template only.
    // It will require modifications to work:
    // - It may require correct/in-range values for request initialization.
    // - It may require specifying regional endpoints when creating the service client as shown in
    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
      SearchEntriesRequest request =
          SearchEntriesRequest.newBuilder()
              .setName(LocationName.of("[PROJECT]", "[LOCATION]").toString())
              .setQuery("query107944136")
              .setPageSize(883849137)
              .setPageToken("pageToken873572522")
              .setOrderBy("orderBy-1207110587")
              .setScope("scope109264468")
              .setSemanticSearch(true)
              .build();
      for (SearchEntriesResult element : catalogServiceClient.searchEntries(request).iterateAll()) {
        // doThingsWith(element);
      }
    }
  }
}

Python

Python

このサンプルを試す前に、クライアント ライブラリを使用した Dataplex Universal Catalog のクイックスタートにある Python の設定手順を完了してください。詳細については、Dataplex Universal Catalog Python API のリファレンス ドキュメントをご覧ください。

Dataplex Universal Catalog で認証を行うには、アプリケーションのデフォルト認証情報を設定します。詳細については、ローカル開発環境の認証の設定をご覧ください。

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import dataplex_v1


def sample_search_entries():
    # Create a client
    client = dataplex_v1.CatalogServiceClient()

    # Initialize request argument(s)
    request = dataplex_v1.SearchEntriesRequest(
        name="name_value",
        query="query_value",
    )

    # Make the request
    page_result = client.search_entries(request=request)

    # Handle the response
    for response in page_result:
        print(response)

Ruby

Ruby

このサンプルを試す前に、クライアント ライブラリを使用した Dataplex Universal Catalog のクイックスタートにある Ruby の設定手順を完了してください。詳細については、Dataplex Universal Catalog Ruby API のリファレンス ドキュメントをご覧ください。

Dataplex Universal Catalog で認証を行うには、アプリケーションのデフォルト認証情報を設定します。詳細については、ローカル開発環境の認証の設定をご覧ください。

require "google/cloud/dataplex/v1"

##
# Snippet for the search_entries call in the CatalogService service
#
# This snippet has been automatically generated and should be regarded as a code
# template only. It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
# client as shown in https://cloud.google.com/ruby/docs/reference.
#
# This is an auto-generated example demonstrating basic usage of
# Google::Cloud::Dataplex::V1::CatalogService::Client#search_entries.
#
def search_entries
  # Create a client object. The client can be reused for multiple calls.
  client = Google::Cloud::Dataplex::V1::CatalogService::Client.new

  # Create a request. To set request fields, pass in keyword arguments.
  request = Google::Cloud::Dataplex::V1::SearchEntriesRequest.new

  # Call the search_entries method.
  result = client.search_entries request

  # The returned object is of type Gapic::PagedEnumerable. You can iterate
  # over elements, and API calls will be issued to fetch pages as needed.
  result.each do |item|
    # Each element is of type ::Google::Cloud::Dataplex::V1::SearchEntriesResult.
    p item
  end
end

REST

リソースを検索するには、searchEntries メソッドを使用します。

エントリの詳細を表示する

コンソール

Dataplex Universal Catalog 検索を使用して、エントリの詳細を表示します。

  1. Dataplex Universal Catalog でエントリを検索します。

  2. 検索結果で、詳細を表示するエントリをクリックします。

    [エントリの詳細] ページが開きます。このページには次のセクションがあります。

    • エントリの詳細: エントリの種類、システム、プラットフォーム、完全修飾名、作成日時、最終更新日時、説明、スチュワードなどの情報が含まれます。
    • 概要: エントリの概要(利用可能な場合)。
    • アスペクト: エントリに定義された必須アスペクトとオプションのアスペクト。詳細については、アスペクトのカテゴリをご覧ください。

gcloud

エントリの詳細を表示するには、gcloud dataplex entries lookup コマンドを使用します。

C#

C#

このサンプルを試す前に、クライアント ライブラリを使用した Dataplex Universal Catalog のクイックスタートにある C# の設定手順を完了してください。詳細については、Dataplex Universal Catalog C# API のリファレンス ドキュメントをご覧ください。

Dataplex Universal Catalog で認証を行うには、アプリケーションのデフォルト認証情報を設定します。詳細については、ローカル開発環境の認証の設定をご覧ください。

using Google.Cloud.Dataplex.V1;

public sealed partial class GeneratedCatalogServiceClientSnippets
{
    /// <summary>Snippet for LookupEntry</summary>
    /// <remarks>
    /// This snippet has been automatically generated and should be regarded as a code template only.
    /// It will require modifications to work:
    /// - It may require correct/in-range values for request initialization.
    /// - It may require specifying regional endpoints when creating the service client as shown in
    ///   https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
    /// </remarks>
    public void LookupEntryRequestObject()
    {
        // Create client
        CatalogServiceClient catalogServiceClient = CatalogServiceClient.Create();
        // Initialize request argument(s)
        LookupEntryRequest request = new LookupEntryRequest
        {
            Name = "",
            View = EntryView.Unspecified,
            AspectTypes = { "", },
            Paths = { "", },
            EntryAsEntryName = EntryName.FromProjectLocationEntryGroupEntry("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]"),
        };
        // Make the request
        Entry response = catalogServiceClient.LookupEntry(request);
    }
}

Go

Go

このサンプルを試す前に、クライアント ライブラリを使用した Dataplex Universal Catalog のクイックスタートにある Go の設定手順を完了してください。詳細については、Dataplex Universal Catalog Go API のリファレンス ドキュメントをご覧ください。

Dataplex Universal Catalog で認証を行うには、アプリケーションのデフォルト認証情報を設定します。詳細については、ローカル開発環境の認証の設定をご覧ください。


package main

import (
	"context"

	dataplex "cloud.google.com/go/dataplex/apiv1"
	dataplexpb "cloud.google.com/go/dataplex/apiv1/dataplexpb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := dataplex.NewCatalogClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &dataplexpb.LookupEntryRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/dataplex/apiv1/dataplexpb#LookupEntryRequest.
	}
	resp, err := c.LookupEntry(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}

Java

Java

このサンプルを試す前に、クライアント ライブラリを使用した Dataplex Universal Catalog のクイックスタートにある Java の設定手順を完了してください。詳細については、Dataplex Universal Catalog Java API のリファレンス ドキュメントをご覧ください。

Dataplex Universal Catalog で認証を行うには、アプリケーションのデフォルト認証情報を設定します。詳細については、ローカル開発環境の認証の設定をご覧ください。

import com.google.cloud.dataplex.v1.CatalogServiceClient;
import com.google.cloud.dataplex.v1.Entry;
import com.google.cloud.dataplex.v1.EntryName;
import com.google.cloud.dataplex.v1.EntryView;
import com.google.cloud.dataplex.v1.LookupEntryRequest;
import java.util.ArrayList;

public class SyncLookupEntry {

  public static void main(String[] args) throws Exception {
    syncLookupEntry();
  }

  public static void syncLookupEntry() throws Exception {
    // This snippet has been automatically generated and should be regarded as a code template only.
    // It will require modifications to work:
    // - It may require correct/in-range values for request initialization.
    // - It may require specifying regional endpoints when creating the service client as shown in
    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
      LookupEntryRequest request =
          LookupEntryRequest.newBuilder()
              .setName("name3373707")
              .setView(EntryView.forNumber(0))
              .addAllAspectTypes(new ArrayList<String>())
              .addAllPaths(new ArrayList<String>())
              .setEntry(
                  EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]").toString())
              .build();
      Entry response = catalogServiceClient.lookupEntry(request);
    }
  }
}

Python

Python

このサンプルを試す前に、クライアント ライブラリを使用した Dataplex Universal Catalog のクイックスタートにある Python の設定手順を完了してください。詳細については、Dataplex Universal Catalog Python API のリファレンス ドキュメントをご覧ください。

Dataplex Universal Catalog で認証を行うには、アプリケーションのデフォルト認証情報を設定します。詳細については、ローカル開発環境の認証の設定をご覧ください。

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import dataplex_v1


def sample_lookup_entry():
    # Create a client
    client = dataplex_v1.CatalogServiceClient()

    # Initialize request argument(s)
    request = dataplex_v1.LookupEntryRequest(
        name="name_value",
        entry="entry_value",
    )

    # Make the request
    response = client.lookup_entry(request=request)

    # Handle the response
    print(response)

Ruby

Ruby

このサンプルを試す前に、クライアント ライブラリを使用した Dataplex Universal Catalog のクイックスタートにある Ruby の設定手順を完了してください。詳細については、Dataplex Universal Catalog Ruby API のリファレンス ドキュメントをご覧ください。

Dataplex Universal Catalog で認証を行うには、アプリケーションのデフォルト認証情報を設定します。詳細については、ローカル開発環境の認証の設定をご覧ください。

require "google/cloud/dataplex/v1"

##
# Snippet for the lookup_entry call in the CatalogService service
#
# This snippet has been automatically generated and should be regarded as a code
# template only. It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
# client as shown in https://cloud.google.com/ruby/docs/reference.
#
# This is an auto-generated example demonstrating basic usage of
# Google::Cloud::Dataplex::V1::CatalogService::Client#lookup_entry.
#
def lookup_entry
  # Create a client object. The client can be reused for multiple calls.
  client = Google::Cloud::Dataplex::V1::CatalogService::Client.new

  # Create a request. To set request fields, pass in keyword arguments.
  request = Google::Cloud::Dataplex::V1::LookupEntryRequest.new

  # Call the lookup_entry method.
  result = client.lookup_entry request

  # The returned object is of type Google::Cloud::Dataplex::V1::Entry.
  p result
end

REST

エントリの詳細を表示するには、lookupEntry メソッドを使用します。

制限事項

自然言語検索には次の制限があります。

  • 自然言語検索は、最も関連性の高い結果を限定的に返すことで、検出と探索に最適化されています。一致するすべての項目の完全なリストが提供されない可能性があるため、このリストに依存するワークロード(キュレーション パイプラインなど)には適していない可能性があります。

  • 自然言語検索では、スキーマ、説明、アスペクトなどのリソース メタデータのみが考慮されます。テーブル内のデータに関する質問(「先月の売上高はいくらでしたか?」など)に回答したり、メタデータに対して分析クエリ(「データセット X にはテーブルがいくつありますか?」など)を実行したりすることはありません。

  • 一般公開リソースは自然言語検索の対象外です。

次のステップ