Your team uses Cloud Composer (Airflow 2) to orchestrate a nightly pipeline that stages CSV files from Cloud Storage into BigQuery, transforms them, and then publishes dashboards. Compliance now requires the pipeline to stop and alert operations when more than 0.5 % of rows are missing the mandatory customer_id field or when any transaction_date is set in the future. The team wants to reuse managed services and write as little custom code as possible. Which design meets these requirements?
Replace the load step with a custom Dataflow Flex Template that calculates data-quality metrics and publishes them to Pub/Sub; a Cloud Run service reads the metrics, decides whether to continue, and triggers later DAG tasks through Cloud Tasks.
Add a BigQueryCheckOperator in the DAG immediately after the staging load. The task runs SQL assertions for the null-rate and future-date rules, fails if they are violated, triggers Composer's built-in alerts, and all downstream tasks depend on its success.
Create a Cloud Logging log-based metric that counts BigQuery load-job errors; configure an alerting policy to notify operators and let the remaining DAG tasks run regardless of the metric value.
Define a NOT NULL constraint on customer_id in the target table and schedule a nightly BigQuery job to delete any rows with future transaction_date values after loading completes; continue running transformations even if deletions occur.
Using Cloud Composer's native BigQueryCheckOperator keeps the solution almost entirely declarative and fully managed. After the load step writes the file to a staging table, a BigQueryCheckOperator task can run two SQL assertions:
COUNTIF(customer_id IS NULL) / COUNT(*) < 0.005
COUNTIF(transaction_date > CURRENT_DATE()) = 0 The operator fails automatically when either test returns FALSE, which blocks all downstream tasks because they are set to depend on this check. Composer's built-in alerting (email, Pub/Sub, or PagerDuty) can be enabled on task failure, satisfying the requirement to notify operations. The approach avoids extra infrastructure and custom services.
The log-based alert option does not evaluate business-level rules or stop the DAG; it only reacts to generic load errors. Relying on NOT NULL constraints plus a cleanup query addresses at most one rule and still allows invalid files containing too many nulls to pass. Building a custom Dataflow template and Cloud Run controller adds significant bespoke code and operational overhead compared with using Composer's and BigQuery's native capabilities.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is Cloud Composer and how does it relate to Airflow?
Open an interactive chat with Bash
How does BigQueryCheckOperator work in Cloud Composer?
Open an interactive chat with Bash
Why is using managed services preferable to custom code in this pipeline design?
Open an interactive chat with Bash
What is Cloud Composer?
Open an interactive chat with Bash
What is a BigQueryCheckOperator?
Open an interactive chat with Bash
How does Cloud Composer send alerts?
Open an interactive chat with Bash
GCP Professional Data Engineer
Maintaining and automating data workloads
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99 $11.99
$11.99/mo
Billed monthly, Cancel any time.
$19.99 after promotion ends
3 Month Pass
$44.99 $26.99
$8.99/mo
One time purchase of $26.99, Does not auto-renew.
$44.99 after promotion ends
Save $18!
MOST POPULAR
Annual Pass
$119.99 $71.99
$5.99/mo
One time purchase of $71.99, Does not auto-renew.
$119.99 after promotion ends
Save $48!
BEST DEAL
Lifetime Pass
$189.99 $113.99
One time purchase, Good for life.
Save $76!
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .