Cert EspressoLearn. Practise. Find your flow.

A LITTLE FOCUS.
A BIG NEXT STEP.

Your pace. Your space.
Google Cloud · Associate Data Practitioner

Data quality and cleaning

Associate Data Practitioner · Lesson 2 of 16 · 9:02

YouTube loads only after you press play. This chapter opens at its timestamp in the full course. Watch on YouTube ↗

Learning with these videos? Subscribe for new courses and exam-style questions.

In this lesson

Prepare for the Google Cloud Associate Data Practitioner exam, on the official exam guide. In this lesson: the dimensions of data quality (completeness, validity, uniqueness, consistency, timeliness), data profile and data quality scans in Knowledge Catalog, cleaning with SQL in BigQuery (repeated rows, safe casts, missing values) and with data preparation, and cleaning with Cloud Data Fusion and Dataflow. Includes three original practice questions, with Cymbal Energy, a fictional electricity and gas supplier, as the example.

Study notes

The text of this lesson, to read at your own pace. Information as of November 2026.

A town that used ten times more

Cymbal Energy's first dashboard shows a town that used ten times more electricity than usual last Tuesday. The cause is not the weather: a batch of readings arrived twice, and some meters sent negative values. Before anyone trusts the numbers, the data practitioner must measure data quality, and clean the data.

Dimensions of data quality

Data quality has several dimensions. Completeness: are values missing, like readings with no meter number? Validity: do values follow the rules, like a reading that is never negative? Uniqueness: does each event appear once, with no repeated rows? And consistency and timeliness: do systems agree with each other, and does the data arrive when it is needed?

Assessing quality

To assess quality, start with a profile: a data profile scan in Knowledge Catalog, formerly Dataplex Universal Catalog, reports statistics for each column, like common values, distributions, and the share of empty values. Then write rules: a data quality scan checks a table against rules, like not null, a value range, or uniqueness, and gives a quality score for each dimension. You can also check with plain SQL, by counting empty values or repeated rows in BigQuery. And run these checks on a schedule, so a bad batch is caught before it reaches a dashboard.

Cleaning with SQL

Much cleaning happens with SQL, right in BigQuery. To remove repeated rows, number the rows of each event with the row number function, and keep only the first one, with a qualify clause. To fix types safely, the safe cast function returns null instead of an error when a value cannot be converted. Fill missing values with coalesce, trim spaces, and standardize spellings, like city names. And BigQuery data preparation uses Gemini to suggest cleaning steps on a sample of your table, and Dataform can then run them on a schedule.

Data Fusion and Dataflow

Not every team writes SQL. Cloud Data Fusion is a visual tool with no code, and its Wrangler lets you clean data by pointing and clicking on a sample, each step saved as a directive in a recipe, before the pipeline runs on the whole dataset. Dataflow cleans data in code, with Apache Beam, at any scale, in batch or in streaming, so it fits readings that must be cleaned as they arrive. And bad records do not have to stop a pipeline: send them to a dead letter table, and review them later.

Choosing the cleaning tool

So which tool cleans the data? Data already in BigQuery, and a team that knows SQL: SQL in BigQuery, with Dataform to schedule it. A team without developers, and many sources: Cloud Data Fusion. Streaming data, or very large files that must be cleaned before they land: Dataflow.

Recap

Let's recap. Data quality covers completeness, validity, uniqueness, consistency, and timeliness. A data profile scan describes every column, and a data quality scan checks rules and scores each dimension. In BigQuery, SQL removes repeated rows, converts types safely, and fills missing values, and data preparation suggests steps with Gemini. Cloud Data Fusion cleans data visually, with Wrangler. And Dataflow cleans data in code, at scale and in streaming, with a dead letter output for bad records.

Quick checks for this lesson

The 3 questions of this lesson, as plain text. The button above runs them with shuffled choices and the reason behind every choice.

  1. Before writing any rule, the data team wants statistics for every column of a new readings table: common values, distributions, and the share of empty values. What should it use?

    • A data quality scan with custom rules
    • Cloud Monitoring alerting policies
    • A data profile scan in Knowledge Catalog
    • A snapshot of the readings table
    Show the answer

    A data profile scan in Knowledge Catalog

    A data profile scan describes every column, with no rule to write first. “A data quality scan with custom rules” only tests rules that someone has already written. “Cloud Monitoring alerting policies” only watches metrics about systems, not the values in a table. And “A snapshot of the readings table” only keeps a copy of the table, without describing it.

  2. A retry sent the same meter events twice, so the raw readings table holds exact copies. In BigQuery, how should the data practitioner keep a single row for each event?

    • Number the rows of each event, and keep row one
    • Convert the readings with SAFE_CAST
    • Fill the empty values with COALESCE
    • Add a description to the event column
    Show the answer

    Number the rows of each event, and keep row one

    Numbering the rows of each event, and keeping row number one, leaves exactly one row per event. “Convert the readings with SAFE_CAST” only converts types, and both copies would remain. “Fill the empty values with COALESCE” only fills empty values, and the repeated rows stay. And “Add a description to the event column” only documents the column, without changing any row.

  3. Meter readings stream in all day. Every reading with no meter number must be set aside for review before it reaches BigQuery, without stopping the stream. What fits best?

    • A scheduled query that runs every night
    • A weekly data quality scan on the table
    • Delete those readings at the source
    • A Dataflow pipeline with a dead letter output
    Show the answer

    A Dataflow pipeline with a dead letter output

    A Dataflow pipeline cleans the stream as it arrives, and sends bad readings to a dead letter output for review. “A scheduled query that runs every night” would only act after the readings have already landed. “A weekly data quality scan on the table” only reports a score, without setting any reading aside. And “Delete those readings at the source” would destroy readings that someone needs to review.