professional-cloud-data-engineer
Prepare and test your skills
Prepare and test your skills
A five-step process flow showing how BigQuery deduplicates a raw table: rows are partitioned by business key, ordered by ingestion timestamp, numbered with ROW_NUMBER(), and filtered to keep only row number 1, leaving one clean row per key. A footnote notes that partitioning by date and clustering on keys limits the scan to relevant blocks.

A process flow showing records from a Cloud Pub/Sub buffer entering an Apache Beam validation step in Cloud Dataflow: valid rows commit to a BigQuery sink, while failed rows are routed through a side output to a dead-letter queue that fans out to Cloud Storage, Pub/Sub alerts, and a BigQuery dead-letter table. The animation traces a valid record and then a failed record along their branches, showing the pipeline never halts.
The BigQuery Storage Write API isolates individual row-level errors into a separate PCollection via getFailedStorageApiInserts, allowing valid rows in the batch to commit successfully while routing failed rows to dead-letter sinks. In contrast, the FILE_LOADS method processes data through intermediate staging files and causes the entire batch load job to fail with a runtime exception when an error occurs.
Apache Beam pipelines use side outputs to evaluate incoming records and route corrupt or invalid elements directly to a dead-letter queue (DLQ) while directing valid records down the main pipeline branch. These isolated records can be stored in Cloud Storage for long-term archiving, Cloud Pub/Sub for operational alerts, or BigQuery dead-letter tables for analyzing data quality trends.
Post-ingestion deduplication in BigQuery uses the ROW_NUMBER() window function to partition records by business keys and order them by ingestion timestamp or version, keeping only rows where ROW_NUMBER() equals 1. To optimize query performance and reduce scan costs across large datasets, target tables are partitioned by date or timestamp columns and clustered on primary lookup keys.
Dataplex runs automated data quality rule scans for uniqueness, completeness, and validity against target datasets in BigQuery and Cloud Storage based on configured threshold boundaries. When metrics breach these thresholds, Dataplex triggers alerts to data owners and publishes the scan results and quality history directly to the Dataplex Universal Catalog as metadata attributes.
Post-ingestion deduplication in Google Cloud BigQuery is the process of identifying and removing redundant records after data has already landed in warehouse tables. Upstream pipeline retries, network failures, and overlapping batch loads often introduce duplicate records into target tables. Data engineers formulate structured query language (SQL) queries and stored procedures to detect duplicate entries, enforce schema constraints, and format values consistently across petabyte-scale datasets.
Identifying and resolving duplicate records in BigQuery relies on analytical SQL window functions such as ROW_NUMBER(). A deduplication query partitions records by primary or business keys and orders them by an ingestion timestamp or version field to assign a unique sequence number to each row within a key group. The query filters for rows where ROW_NUMBER() = 1 to preserve the most recent or primary entry while discarding duplicate occurrences. To execute these operations efficiently over large datasets, tables are partitioned by date or timestamp columns and clustered on primary lookup keys, which limits query processing only to relevant data blocks and reduces overall scan costs.
Data standardization transforms inconsistent values across a dataset into unified formats, naming conventions, and value ranges. BigQuery provides built-in SQL functions such as CAST() to enforce schema data types, FORMAT_TIMESTAMP() to convert varied date inputs into standardized ISO formats, and UPPER(), LOWER(), and TRIM() to normalize text strings. Engineers encapsulate these transformation and deduplication routines into stored procedures, which accept runtime parameters and execute on scheduled intervals to eliminate manual query execution. Choosing the right cleansing tool depends on the development environment and pipeline design:
| Tool | Primary interface | Processing model |
|---|---|---|
| BigQuery SQL and stored procedures | SQL scripts and procedures | Batch processing executed natively within the data warehouse |
| Cloud Dataprep | Visual, interactive user interface | Interactive profiling with recipes executed on distributed worker clusters |
| Cloud Dataflow | Apache Beam pipeline code | Scalable real-time streaming and high-throughput batch transformations |
| Dataform | Version-controlled SQL workflows | Scheduled, dependency-aware SQL pipeline orchestration inside BigQuery |
Error handling in Cloud Dataflow allows data pipelines to filter and isolate corrupt records without interrupting the processing of valid streaming or batch data. Cloud Dataflow executes Apache Beam pipelines that validate incoming elements against predefined schemas and business rules. Isolating malformed records ensures that downstream analytical sinks receive clean, dependable data while the pipeline maintains continuous operation.
Apache Beam pipelines isolate invalid or corrupt records by routing them through side outputs instead of throwing runtime exceptions that halt pipeline execution. A primary processing step evaluates incoming records and directs valid records down the main pipeline branch while routing failed records to a dead-letter queue (DLQ). Isolating malformed records into a dead-letter queue allows engineers to preserve the raw unformatted payloads alongside error metadata for auditing and reprocessing:
Pipelines handle transient errors by applying truncated exponential backoff to delay retries without overwhelming downstream services. Records rejected due to non-retryable syntax errors or exhausted retry attempts are classified as poison records and routed directly to the dead-letter queue. To prevent pipeline overload during traffic spikes, Cloud Pub/Sub functions as an ingestion buffer that absorbs incoming data bursts and maintains a steady throughput into downstream sinks.
Pipelines writing data to BigQuery must manage destination insertion errors based on the configured write method. When using the BigQuery Storage Write API, write errors are captured at the individual row level and returned as a separate PCollection by calling getFailedStorageApiInserts on the pipeline's WriteResult object. This failure stream routes failed rows directly into dead-letter sinks while valid rows in the same batch commit successfully. In contrast, using the FILE_LOADS batch mode loads data through intermediate staging files, which causes the entire load job to fail with a runtime exception rather than returning individual row-level errors.
Exam tip: The BigQuery Storage Write API captures individual row-level insertion failures using getFailedStorageApiInserts for dead-letter routing, whereas the batch FILE_LOADS method aborts the entire load job on an error without exposing individual row details.
Cloud Dataprep and Dataplex provide visual data profiling and automated governance to detect anomalies, enforce quality rules, and maintain metadata across Google Cloud storage systems. Cloud Dataprep delivers a visual interface for interactive data discovery and data transformation, compiling user-defined recipes into scalable pipeline jobs. Dataplex acts as a centralized governance layer that continuously monitors data assets across organizations to ensure regulatory compliance and dataset reliability.
Visual profiling in Cloud Dataprep allows engineers to explore data structures, evaluate distributions, and identify anomalies without writing code. The graphical interface automatically surfaces missing values, data type mismatches, and numerical outliers across source datasets. Users build cleansing and normalization steps into reusable transformation recipes that standardize text, convert dates, and filter out invalid rows. Once finalized, Cloud Dataprep executes these recipes at scale by deploying them as managed Cloud Dataflow jobs.
Continuous data governance in Dataplex organizes and monitors structured and unstructured data assets across BigQuery and Cloud Storage. The Dataplex Universal Catalog discovers and inventories storage assets across projects to provide a unified metadata inventory. Within Dataplex, engineers define automated data quality specifications containing validation rules for uniqueness, completeness through null checks, and validity through regular expression pattern matches. Automated profiling scans run against target datasets to verify compliance against configured thresholds, such as requiring 100% validity on account identifier columns.
When data quality metrics breach established threshold boundaries, Dataplex triggers alerts across monitoring and email channels to notify data owners. Scan results and quality history publish directly back to the Dataplex Catalog as metadata attributes. This metadata enrichment allows downstream analysts and automated workflows to verify the quality and trust score of an asset before incorporating it into production analytics.
ROW_NUMBER() window function partitioned by unique business keys to filter duplicate records, while table partitioning and clustering reduce data scanning costs.getFailedStorageApiInserts, whereas the FILE_LOADS batch method fails the entire load job upon encountering an error.A data engineering team is implementing a data cleansing and quality governance framework for raw transaction data ingested daily into BigQuery. To prevent data corruption from impacting downstream analytics, the team must meet the following requirements:
Which solution should the team implement in Dataplex to satisfy these requirements?