
Before you begin
- Labs create a Google Cloud project and resources for a fixed time
- Labs have a time limit and no pause feature. If you end the lab, you'll have to restart from the beginning.
- On the top left of your screen, click Start lab to begin
Create a lake, zone, and asset
/ 20
Query BigQuery table to review data quality
/ 20
Create and upload a data quality specification file
/ 20
Define and run a data quality job
/ 20
Review data quality results in BigQuery
/ 20
Dataplex is an intelligent data fabric that enables organizations to centrally discover, manage, monitor, and govern their data across data lakes, data warehouses, and data marts to power analytics at scale.
A valuable feature of Dataplex is the ability to define and run data quality checks on Dataplex assets such as BigQuery tables and Cloud Storage files. Using Dataplex data quality tasks, you can integrate data quality checks into everyday workflows by validating data that is part of a data production pipline, regularly monitoring the quality of your data against a set of criteria, and building data quality reports for regulatory requirements.
In this lab, you learn how to assess data quality using Dataplex by creating a custom data quality specification file and using it to define and run a data quality job on BigQuery data.
Read these instructions. Labs are timed and you cannot pause them. The timer, which starts when you click Start Lab, shows how long Google Cloud resources are made available to you.
This hands-on lab lets you do the lab activities in a real cloud environment, not in a simulation or demo environment. It does so by giving you new, temporary credentials you use to sign in and access Google Cloud for the duration of the lab.
To complete this lab, you need:
Click the Start Lab button. If you need to pay for the lab, a dialog opens for you to select your payment method. On the left is the Lab Details pane with the following:
Click Open Google Cloud console (or right-click and select Open Link in Incognito Window if you are running the Chrome browser).
The lab spins up resources, and then opens another tab that shows the Sign in page.
Tip: Arrange the tabs in separate windows, side-by-side.
If necessary, copy the Username below and paste it into the Sign in dialog.
You can also find the Username in the Lab Details pane.
Click Next.
Copy the Password below and paste it into the Welcome dialog.
You can also find the Password in the Lab Details pane.
Click Next.
Click through the subsequent pages:
After a few moments, the Google Cloud console opens in this tab.
Cloud Shell is a virtual machine that is loaded with development tools. It offers a persistent 5GB home directory and runs on the Google Cloud. Cloud Shell provides command-line access to your Google Cloud resources.
Click Activate Cloud Shell at the top of the Google Cloud console.
Click through the following windows:
When you are connected, you are already authenticated, and the project is set to your Project_ID,
gcloud
is the command-line tool for Google Cloud. It comes pre-installed on Cloud Shell and supports tab-completion.
Output:
Output:
gcloud
, in Google Cloud, refer to the gcloud CLI overview guide.
In the Google Cloud Console, enter Cloud Dataproc API in the top search bar.
Click on the result for Cloud Dataproc API under Marketplace.
Click Enable.
To define and run data quality tasks, you first need to create some Dataplex resources.
In this task, you create a new Dataplex lake to store ecommerce customer information, add a raw zone to the lake, and then attach a pre-created BigQuery dataset as a new asset in the zone.
If prompted Welcome to the new Dataplex experience
, click Close.
Under Manage lakes, click Manage.
Click Create lake.
Enter the required information to create a new lake:
Property | Value |
---|---|
Display Name | Ecommerce Lake |
ID | Leave the default value. |
Region |
Leave the other default values.
It can take up to 3 minutes for the lake to be created.
On the Manage tab, click on the name of your lake.
Click +ADD ZONE.
Enter the required information to create a new zone:
Property | Value |
---|---|
Display Name | Customer Contact Raw Zone |
ID | Leave the default value. |
Type | Raw zone |
Data locations | Regional |
Leave the other default values.
For example, the option for Enable metadata discovery under Discovery settings is enabled by default and allows authorized users to discover the data in the zone.
It can take up to 2 minutes for the zone to be created.
On the Zones tab, click on the name of your zone.
On the Assets tab, click +ADD ASSET.
Click Add an asset.
Enter the required information to attach a new asset:
Property | Value |
---|---|
Type | BigQuery dataset |
Display Name | Contact Info |
ID | Leave the default value. |
Dataset |
|
Leave the other default values.
Click Done.
Click Continue.
For Discovery settings, select Inherit to inherit the Discovery settings from the zone level, and then click Continue.
Click Submit.
Click Check my progress to verify the objective.
In the previous task, you created a new Dataplex asset from a BigQuery dataset named customers that has been pre-created for this lab. This dataset contains a table named contact_info which contains raw contact information for customers of a fictional ecommerce company.
In this task, you query this table to start identifying some potential data quality issues that you can include as checks in a data quality job. You also identify another precreated dataset that you can use to store data quality job results in a later task.
In the Google Cloud Console, in the Navigation menu (), navigate to BigQuery.
In the Explorer pane, expand the arrow next to your project ID to list the contents:
In addition to the customer_contact_raw_zone dataset created by Dataplex to manage that zone, there are two BigQuery datasets that were precreated for this lab:
The dataset named customers contains one table named contact_info, which contains contact information for customers such as a customer ID, name, email, and more. This is the table that you explore and check for data quality issues throughout this lab.
The dataset named customers_dq_dataset does not contain any tables. When you define a data quality job in a later task, you use this dataset as the destination for a new table containing the data quality job results.
This query selects 50 records from the original table and orders the records by the customer id in the results.
Notice that some records are missing customer IDs or have incorrect emails, which can make it difficult to manage customer orders.
Click Check my progress to verify the objective.
Dataplex data quality check requirements are defined using CloudDQ YAML specification files. Once created, the YAML specification file is uploaded to a Cloud Storage bucket that is made accessible to the data quality job.
The YAML file has four keys sections:
In this task, you define a new YAML specification file for data quality checks that identify null customer IDs and emails in the specified BigQuery table. After you define the file, you upload it to a pre-created Cloud Storage bucket for use in a later task to run the data quality job.
The dq-customer-raw-data.yaml
file begins with key parameters to identify the Dataplex resources including the project ID, region, and names of the Dataplex lake and zone.
Next, it specifies the allowed rule dimensions and two primary rules:
Last, the rules are bound to entities (tables) and columns using rule bindings for data quality validation:
Ctrl+X
, then Y
, to save and close the file.Click Check my progress to verify the objective.
The data quality process uses a data quality specification YAML file to run a data quality job and generates data quality metrics that are written to a BigQuery dataset.
In this task, you define and run a data quality job using the data quality specification YAML file uploaded to Cloud Storage in the previous task. When you define the job, you also specify a pre-created BigQuery dataset named customer_dq_dataset to store the data quality results.
In the Google Cloud Console, in the Navigation menu (), navigate to Analytics > Dataplex.
Under Manage lakes, click Process.
Click +CREATE TASK.
Under Check Data Quality, click Create task.
Enter the required information to create a new data quality job:
Property | Value |
---|---|
Dataplex lake | ecommerce-lake |
Display name | Customer Data Quality Job |
ID | Leave the default value. |
Select GCS file |
|
Select BigQuery dataset |
|
BigQuery table | dq_results |
User service account | Compute Engine default service account |
Leave the other default values.
Note that the Compute Engine default service account has been preconfigured for this lab to have the appropriate IAM roles and permissions. For more information, review the Dataplex documentation titled Create a service account.
Click Continue.
For Start, select Immediately.
Click Create.
Click Check my progress to verify the objective.
In this task, you review the tables in the customers_dq_dataset to identify records that are missing customer ID values or have an invalid values for emails.
In the Google Cloud Console, in the Navigation menu (), navigate to BigQuery.
In the Explorer pane, expand the arrow next to your project ID to list the contents:
Expand the arrow next to the customer_dq_dataset dataset.
Click on the dq_summary table.
Click on the Preview tab to see the results.
The dq summary table provides useful information about the overall data quality including the number of records that were identified to not adhere to the two rules in the data quality specification file.
Scroll to the last column named failed_records_query.
Click on the down arrow in the first row to expand the text and view the entire query for the VALID_EMAIL rule results.
Note that the query is quite long and ends with ORDER BY _dq_validation_rule_id
.
The results of the query provide the email values in the contact_info table that are not valid.
The results of the query identify that there are 10 records in the contact_info table that are missing ID values.
Click Check my progress to verify the objective.
You assessed data quality using Dataplex by creating a custom data quality specification file and using it to run a data quality job on a BigQuery table.
...helps you make the most of Google Cloud technologies. Our classes include technical skills and best practices to help you get up to speed quickly and continue your learning journey. We offer fundamental to advanced level training, with on-demand, live, and virtual options to suit your busy schedule. Certifications help you validate and prove your skill and expertise in Google Cloud technologies.
Manual Last Updated October 22, 2024
Lab Last Tested October 22, 2024
Copyright 2025 Google LLC All rights reserved. Google and the Google logo are trademarks of Google LLC. All other company and product names may be trademarks of the respective companies with which they are associated.
This content is not currently available
We will notify you via email when it becomes available
Great!
We will contact you via email if it becomes available
One lab at a time
Confirm to end all existing labs and start this one