Cleaning up bad or malformed records during ingestion
Data cleansing on Google Cloud is primarily handled through Dataprep by Trifacta for interactive, visual data wrangling, Dataflow for programmatic batch/streaming cleansing at scale, and BigQuery for SQL-based cleansing during or after load. The right tool depends on whether cleansing needs to be visual/exploratory, code-based and scalable, or SQL-native and post-load.
1 · Learn the must-know
- Dataprep by Trifacta provides a serverless, visual UI for exploring, cleaning, and transforming data, automatically suggesting transformations and generating a reusable recipe that can run as a Dataflow job.
- Dataflow (Apache Beam) is the preferred choice for complex, programmatic, and scalable cleansing logic (deduplication, schema validation, type coercion) applied to both batch and streaming pipelines.
- BigQuery supports cleansing via SQL during ELT (using CREATE TABLE AS SELECT, MERGE, or scheduled queries) and can handle malformed rows on load using options like
max_bad_recordsand ignoreUnknownValues. - Cloud Data Fusion offers a GUI-based, code-free way to build ETL/ELT pipelines with built-in cleansing transformations (like Wrangler directives) and is often preferred when a low-code, plugin-based approach is required.
- For streaming data, cleansing logic should be embedded early in the pipeline (e.g., in Dataflow or Pub/Sub schema validation) to avoid propagating bad data downstream, since streaming inserts into BigQuery do not support the same load-time error handling as batch loads.
- Data quality and cleansing decisions should consider idempotency and exactly-once processing, especially in streaming Dataflow pipelines, to avoid duplicate or inconsistent cleansed records.
2 · Check your understanding
A retail company loads daily sales CSV files into BigQuery using a Dataflow batch pipeline. Data analysts report that several columns contain unexpected values, such as negative prices and inconsistent date formats. Before finalizing the pipeline transformation logic, the data engineer wants to interactively explore a sample of the data, identify the anomalies, and build repeatable cleansing rules. Which approach should they use?
What you have tried across GCP PDE's objectives, not a readiness score.
Designing data processing systems~22% of the exam0 of 17 tried
Ingesting and processing the data~25% of the exam0 of 11 tried
Storing the data~20% of the exam0 of 13 tried
Preparing and using data for analysis~15% of the exam0 of 11 tried
Maintaining and automating data workloads~18% of the exam0 of 15 tried
3 · Keep going
Ready for more? Take a weighted mock or try free practice questions.