הוספת מטא-נתונים לטבלה ב-BigQuery
Knowledge Catalog (לשעבר Dataplex Universal Catalog) מאפשר לכם לצרף מטא-נתונים עסקיים וטכניים לנכסי הנתונים שלכם, כדי שתוכלו לארגן, לגלות ולנהל את הנתונים. ב-Knowledge Catalog, כל נכס נתונים מיוצג כרשומה, ואתם מצרפים מטא-נתונים על ידי הוספת היבטים – קבוצות של שדות מטא-נתונים קשורים שמוגדרים על ידי תבנית לשימוש חוזר שנקראת סוג היבט.
במדריך הזה ליצירה מהירה, תיצרו מערך נתונים וטבלה ב-BigQuery ממערך נתונים ציבורי ב-BigQuery, תיצרו סוג מאפיין ותוסיפו מאפיין לרשומה בטבלה.
לפני שמתחילים
- נכנסים לחשבון Google Cloud . אנחנו ממליצים למשתמשים חדשים ב- Google Cloud ליצור חשבון כדי שיוכלו להעריך את הביצועים של המוצרים שלנו בתרחישים מהעולם האמיתי. לקוחות חדשים מקבלים בחינם גם קרדיט בשווי 300$ להרצה, לבדיקה ולפריסה של עומסי העבודה.
-
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 role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
-
If you're using an existing project for this guide, verify that you have the permissions required to complete this guide. If you created a new project, then you already have the required permissions.
-
Verify that billing is enabled for your Google Cloud project.
Enable the Dataplex and BigQuery APIs, if any are not already enabled.
Roles required to enable APIs
To enable APIs, you need the
serviceusage.services.enablepermission. If you created the project, then you likely already have this permission through the Owner role (roles/owner). Otherwise, you can get this permission through the Service Usage Admin role (roles/serviceusage.serviceUsageAdmin). Learn how to grant roles.-
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 role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
-
If you're using an existing project for this guide, verify that you have the permissions required to complete this guide. If you created a new project, then you already have the required permissions.
-
Verify that billing is enabled for your Google Cloud project.
Enable the Dataplex and BigQuery APIs, if any are not already enabled.
Roles required to enable APIs
To enable APIs, you need the
serviceusage.services.enablepermission. If you created the project, then you likely already have this permission through the Owner role (roles/owner). Otherwise, you can get this permission through the Service Usage Admin role (roles/serviceusage.serviceUsageAdmin). Learn how to grant roles.
התפקידים הנדרשים
כדי לקבל את ההרשאות שדרושות להוספת מטא-נתונים לטבלה ב-BigQuery, צריך לבקש מהאדמין להקצות לכם את תפקידי ה-IAM הבאים בפרויקט:
- אדמין ב-Dataplex Catalog (
roles/dataplex.catalogAdmin) - בעלים של נתונים ב-BigQuery (
roles/bigquery.dataOwner) - BigQuery Job User (
roles/bigquery.jobUser)
להסבר על מתן תפקידים, ראו איך מנהלים את הגישה ברמת הפרויקט, התיקייה והארגון.
יכול להיות שאפשר לקבל את ההרשאות הנדרשות גם באמצעות תפקידים בהתאמה אישית או תפקידים מוגדרים מראש.
יצירת מערך נתונים וטבלה
במסוף Google Cloud , עוברים לדף BigQuery Studio.
יוצרים מערך נתונים:
בחלונית הימנית, לוחצים על כלי הניתוחים:

אם לא רואים את החלונית הימנית, לוחצים על הרחבת החלונית הימנית כדי לפתוח אותה.
בחלונית Explorer, מוצאים את הפרויקט. לוחצים על View actions, ואז על Create dataset.
בשדה Dataset ID (מזהה מערך הנתונים), מזינים את הערך
catalog_demo_dataset.משאירים את ערכי ברירת המחדל בשאר השדות.
לוחצים על יצירת מערך נתונים.
כדי להעתיק טבלה שגלוי לכולם לקבוצת הנתונים שלכם:
בחלונית Explorer, מחפשים את הטבלה שנקראת
bigquery-public-data.new_york_citibike.citibike_stations. יכול להיות שתצטרכו להגדיר את היקף החיפוש כך שיכלול את הפרויקטbigquery-public-data.הטבלה הזו היא חלק ממערך הנתונים NYC Citi Bike Trips, מערך נתונים ציבורי שמכיל נתונים על תוכנית של אופניים שיתופיים.
בוחרים את הטבלה
citibike_stations.לוחצים על Copy. הזן את פריטי המידע הבאים:
- פרויקט: בוחרים את הפרויקט.
- קבוצת נתונים: בוחרים באפשרות
catalog_demo_dataset. - טבלה: מזינים
bike_stations.
לוחצים על Copy.
בחלונית Explorer, מאתרים את מערך הנתונים
catalog_demo_datasetומוודאים שהטבלהbike_stationsמופיעה במערך הנתונים.
הגדרת תבנית מטא-נתונים: יצירת סוג היבט
במסוף Google Cloud , עוברים לדף Metadata types ב-Knowledge Catalog.
לוחצים על הכרטיסייה סוגי היבטים ואז על הכרטיסייה בהתאמה אישית.
לוחצים על יצירת סוג מאפיין.
בשדה Aspect type ID (מזהה סוג ההיבט), מזינים
data-governance-demo.בקטע מיקום, בוחרים באפשרות
global.בקטע תבנית, לוחצים על הוספת שדה. אפשר להשתמש במידע שבטבלה הבאה כדי להוסיף כמה שדות לסוג ההיבט:
שם סוג חובה תיאור source-of-data-assetטקסט לא - retention-dateתאריך ושעה לא - data-classificationספירה
מוסיפים את הערכים
Public,Sensitiveו-Confidential.כן - has-piiבוליאני כן Whether the data asset has personally identifiable informationלוחצים על Save.
הוספת מטא-נתונים לטבלה: הוספת היבט לרשומה
נכנסים לדף Search בקטלוג הידע במסוף Google Cloud .
בתיבת החיפוש, מזינים
catalog_demo_dataset.בוחרים בטבלה bike_stations.
כדי להוסיף היבט מותאם אישית לרשומה:
בקטע Aspects (היבטים), לצד Optional aspects (היבטים אופציונליים), לוחצים על Add (הוספה).
בוחרים את סוג היחס
data-governance-demo.כך נוצר היבט שמשתמש בסוג ההיבט שלכם כתבנית.
מזינים את הערכים הבאים:
- מקור נכס הנתונים:
Copied from NYC Citi Bike Trips public dataset - תאריך השמירה: מזינים תאריך.
- סיווג נתונים לקטגוריות:
Public - יש פרטים אישיים מזהים:
False
- מקור נכס הנתונים:
לוחצים על Save.
כדי לראות את ערכי המטא-נתונים שהוספתם, בקטע Aspects, בוחרים את ההיבט data-governance-demo.
הסרת המשאבים
כדי לא לצבור חיובים לחשבון Google Cloud על המשאבים שבהם השתמשתם בדף הזה:
מחיקת הפרויקט
הדרך הקלה ביותר להפסיק את החיוב היא למחוק את הפרויקט שיצרתם במדריך למתחילים.
- במסוף Google Cloud , נכנסים לדף Manage resources.
- ברשימת הפרויקטים, בוחרים את הפרויקט שרוצים למחוק ולוחצים על Delete.
- כדי למחוק את הפרויקט, כותבים את מזהה הפרויקט בתיבת הדו-שיח ולוחצים על Shut down.
מחיקת משאבים בודדים
אם רוצים לעשות שימוש חוזר בפרויקט, צריך למחוק את המשאבים שיצרתם.
מחיקת מערך הנתונים:
במסוף Google Cloud , עוברים לדף BigQuery Studio.
בחלונית הימנית, לוחצים על כלי הניתוחים:

בחלונית Explorer, מחפשים את מערך הנתונים
catalog_demo_dataset.לוחצים על View actions (הצגת פעולות) ואז על Delete (מחיקה). מאשרים כשמוצגת בקשה.
מחיקת סוג ההיבט:
במסוף Google Cloud , עוברים לדף Metadata types ב-Knowledge Catalog.
לוחצים על הכרטיסייה סוגי היבטים ואז על הכרטיסייה בהתאמה אישית.
לוחצים על סוג ההיבט
data-governance-demo.לוחצים על Delete. מאשרים כשמוצגת בקשה.