BigQuery 테이블에 메타데이터 추가

Dataplex Universal Catalog의 메타데이터 관리를 시작하는 방법을 알아봅니다.

이 빠른 시작에서는 BigQuery 테이블에 메타데이터를 추가하는 방법을 보여줍니다. 이 빠른 시작에서는 다음 작업을 수행합니다.

  1. 공개 데이터 세트를 기반으로 BigQuery 데이터 세트와 테이블을 만듭니다.

  2. 관련 메타데이터 필드 집합을 정의하는 템플릿을 만듭니다.

    이 템플릿을 관점 유형이라고 합니다. 데이터 애셋의 비즈니스 및 기술 메타데이터를 설명하는 관련 메타데이터 필드의 집합을 관점이라고 합니다.

  3. 테이블에 메타데이터를 추가합니다.

    Dataplex Universal Catalog에서 각 데이터 애셋은 항목으로 표시됩니다. 데이터 애셋에 메타데이터를 연결하려면 항목에 관점을 추가합니다.

시작하기 전에

  1. Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
  2. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator (roles/resourcemanager.projectCreator), which contains the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  3. Verify that billing is enabled for your Google Cloud project.

  4. Enable the Dataplex and BigQuery APIs.

    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 APIs

  5. Make sure that you have the following role or roles on the project: Dataplex Catalog Admin, BigQuery Data Owner, BigQuery Job User

    Check for the roles

    1. In the Google Cloud console, go to the IAM page.

      Go to IAM
    2. Select the project.
    3. In the Principal column, find all rows that identify you or a group that you're included in. To learn which groups you're included in, contact your administrator.

    4. For all rows that specify or include you, check the Role column to see whether the list of roles includes the required roles.

    Grant the roles

    1. In the Google Cloud console, go to the IAM page.

      IAM으로 이동
    2. 프로젝트를 선택합니다.
    3. 액세스 권한 부여를 클릭합니다.
    4. 새 주 구성원 필드에 사용자 식별자를 입력합니다. 일반적으로 Google 계정의 이메일 주소입니다.

    5. 역할 선택 목록에서 역할을 선택합니다.
    6. 역할을 추가로 부여하려면 다른 역할 추가를 클릭하고 각 역할을 추가합니다.
    7. 저장을 클릭합니다.
  6. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator (roles/resourcemanager.projectCreator), which contains the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  7. Verify that billing is enabled for your Google Cloud project.

  8. Enable the Dataplex and BigQuery APIs.

    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 APIs

  9. Make sure that you have the following role or roles on the project: Dataplex Catalog Admin, BigQuery Data Owner, BigQuery Job User

    Check for the roles

    1. In the Google Cloud console, go to the IAM page.

      Go to IAM
    2. Select the project.
    3. In the Principal column, find all rows that identify you or a group that you're included in. To learn which groups you're included in, contact your administrator.

    4. For all rows that specify or include you, check the Role column to see whether the list of roles includes the required roles.

    Grant the roles

    1. In the Google Cloud console, go to the IAM page.

      IAM으로 이동
    2. 프로젝트를 선택합니다.
    3. 액세스 권한 부여를 클릭합니다.
    4. 새 주 구성원 필드에 사용자 식별자를 입력합니다. 일반적으로 Google 계정의 이메일 주소입니다.

    5. 역할 선택 목록에서 역할을 선택합니다.
    6. 역할을 추가로 부여하려면 다른 역할 추가를 클릭하고 각 역할을 추가합니다.
    7. 저장을 클릭합니다.
  10. 데이터 세트 및 테이블 만들기

    1. Google Cloud 콘솔에서 BigQuery Studio 페이지로 이동합니다.

      BigQuery Studio로 이동

    2. 데이터 세트를 만듭니다.

      1. 탐색기 창에서 프로젝트를 찾습니다. 작업 보기를 클릭한 후 데이터 세트 만들기를 클릭합니다.

      2. 데이터 세트 ID 필드에 catalog_demo_dataset를 입력합니다.

        다른 필드에는 기본값을 사용합니다.

      3. 데이터 세트 만들기를 클릭합니다.

    3. 공개 테이블을 데이터 세트에 복사합니다.

      1. 탐색기 창에서 bigquery-public-data.new_york_citibike.citibike_stations라는 테이블을 검색합니다. 검색 범위에 bigquery-public-data 프로젝트를 포함하도록 설정해야 할 수도 있습니다.

        이 테이블은 자전거 공유 프로그램에 관한 데이터가 포함된 공개 데이터 세트인 NYC Citi Bike Trips 데이터 세트의 일부입니다.

      2. citibike_stations 테이블을 선택합니다.

      3. 복사를 클릭합니다. 다음 정보를 입력합니다.

        • 프로젝트: 프로젝트를 선택합니다.
        • 데이터 세트: catalog_demo_dataset를 선택합니다.
        • 테이블: bike_stations를 입력합니다.
      4. 복사를 클릭합니다.

    4. 탐색기 창에서 catalog_demo_dataset 데이터 세트를 찾아 bike_stations 테이블이 데이터 세트에 나열되어 있는지 확인합니다.

    메타데이터 템플릿 정의: 관점 유형 만들기

    1. Google Cloud 콘솔에서 Dataplex Universal Catalog 카탈로그 페이지로 이동합니다.

      카탈로그로 이동

    2. 관점 유형 및 태그 템플릿 탭을 클릭한 다음 커스텀 탭을 클릭합니다.

    3. 관점 유형 만들기를 클릭합니다.

    4. 관점 유형 ID 필드에 data-governance-demo를 입력합니다.

    5. 위치에서 global을 선택합니다.

    6. 템플릿 섹션에서 필드 추가를 클릭합니다. 다음 표의 정보를 사용하여 관점 유형에 여러 필드를 추가합니다.

      이름 유형 필수 항목 설명
      source-of-data-asset 텍스트 아니요 -
      retention-date 날짜 및 시간 아니요 -
      data-classification

      Enum

      Public, Sensitive, Confidential 값을 추가합니다.

      -
      has-pii 불리언 Whether the data asset has personally identifiable information
    7. 저장을 클릭합니다.

    테이블에 메타데이터 추가: 항목에 관점 추가

    1. Google Cloud 콘솔에서 Dataplex Universal Catalog 검색 페이지로 이동합니다.

      검색 페이지로 이동

    2. 검색창에서 catalog_demo_dataset를 입력합니다.

    3. bike_stations 테이블을 선택합니다.

    4. 항목에 커스텀 관점을 추가합니다.

      1. 태그 및 관점 섹션에서 선택적 태그 및 관점 옆에 있는 추가를 클릭합니다.

      2. data-governance-demo 관점 유형을 선택합니다.

        이렇게 하면 관점 유형을 템플릿으로 사용하는 관점이 생성됩니다.

      3. 다음 값을 입력합니다.

        • 데이터 애셋의 소스: Copied from NYC Citi Bike Trips public dataset
        • 보관 날짜: 날짜를 입력합니다.
        • 데이터 분류: Public
        • PII 포함: False
      4. 저장을 클릭합니다.

    5. 추가한 메타데이터 값을 확인하려면 태그 및 관점 섹션에서 data-governance-demo 관점을 선택합니다.

    삭제

    이 페이지에서 사용한 리소스 비용이 Google Cloud 계정에 청구되지 않도록 하려면 다음 단계를 수행합니다.

    프로젝트 삭제

    비용 청구를 중지하는 가장 쉬운 방법은 이 빠른 시작에서 만든 프로젝트를 삭제하는 것입니다.

    1. In the Google Cloud console, go to the Manage resources page.

      Go to Manage resources

    2. In the project list, select the project that you want to delete, and then click Delete.
    3. In the dialog, type the project ID, and then click Shut down to delete the project.

    개별 리소스 삭제

    프로젝트를 재사용하려면 만든 리소스를 삭제합니다.

    1. 데이터 세트를 삭제합니다.

      1. Google Cloud 콘솔에서 BigQuery Studio 페이지로 이동합니다.

        BigQuery Studio로 이동

      2. 탐색기 창에서 catalog_demo_dataset 데이터 세트를 검색합니다.

      3. 작업 보기를 클릭한 다음 삭제를 클릭합니다. 메시지가 표시되면 확인합니다.

    2. 관점 유형을 삭제합니다.

      1. Google Cloud 콘솔에서 Dataplex Universal Catalog 카탈로그 페이지로 이동합니다.

        카탈로그로 이동

      2. 관점 유형 및 태그 템플릿 탭을 클릭한 다음 커스텀 탭을 클릭합니다.

      3. data-governance-demo 관점 유형을 클릭합니다.

      4. 삭제를 클릭합니다. 메시지가 표시되면 확인합니다.

    다음 단계