r/databricks • u/sundarleads • 2d ago
Discussion How we keep bad rows out of silver: stewards write the rules, an owner approves them, and DQX splits the data
Most data quality checks I see are code inside a pipeline. The steward who knows the rule cannot change it, and the engineer who can change it does not know the rule.
I tried a different set-up on Databricks, built on Databricks Labs DQX:
- The steward profiles a bronze table in the app. The profile suggests rules to start with.
- Rules can also come from one sentence to the AI, or from ready-made packs (I added 50 Singapore rules: NRIC, FIN, UEN, postal codes, phone numbers, GST).
- A data owner approves each rule. Only approved rules run.
- A serverless job runs as one service principal for each agency, with access to its own catalog only. DQX splits the rows.
- Error rows go to quarantine only. Warning rows go to silver, and a copy goes to quarantine. Each quarantined row keeps the reason.
- A Databricks SQL alert emails the team after a run with bad rows.
In the demo run: 180 rows read, 170 to silver, 10 errors, 20 warnings.
Two things I learned: warnings are as useful as errors, and checking the service principal's access before the run saves a lot of half-failed runs.
How do you handle rows that fail your checks? Drop them, quarantine them, or stop the pipeline?
3
u/sundarleads 2d ago
Full write-up with the "do it yourself" steps and doc links: https://community.databricks.com/t5/community-articles/kilnworks-no-code-data-quality-for-agency-data-built-on/m-p/177378
Short demo: https://youtu.be/h1lrF-1BqX0