r/SQL • u/yuvrajsingh1205 • Mar 26 '26
MySQL What’s your process for validating data after ETL jobs?
Curious how others handle this —
After running a pipeline (like MySQL → BigQuery / Snowflake), how do you make sure the data is actually correct?
Do you rely on:
- row count checks?
- schema comparison?
- custom scripts?
Or is there a better way?
Trying to understand real-world practices and pain points here.
Not promoting anything — just learning.
23
Upvotes
14
u/Enigma1984 Mar 26 '26 edited Mar 26 '26
Depends. If I'm ingesting to bronze I check row counts match, schema is the same and data types are correct.
If I'm going bronze to silver then I check for nulls, duplicates, data formatting, missing foreign keys and sometimes outliers.
Silver to gold I check for row counts again to ensure joins haven't blown up my data, data types again to make sure reporting works cleanly, nulls again for completeness, and fact/dim relationships to make sure we don't have loads of orphaned rows.
I'm sure I do other stuff too but that's about the shape of it for most use cases.
7
u/JEY1337 Mar 26 '26
Im using dbt tests
6
u/Eleventhousand Mar 26 '26
So, if I am loading a columnstore database, that doesn't enforce any unique constraints, I have a step that will fail my DAG if any duplicates are detected, before they can make their way into the target table.
For other validation steps, since its kind of wild west where I am now, what I did in a prior life was to set up some boiler plate checklists for my team. We just copy/pasted the results to the ticket to show that the checks passed:
For testing things that are already in production, I used two approaches
6
u/greendookie69 Mar 27 '26
"John, do the numbers on this report look right to you?"
"...I guess"
Send it...
1
u/AUGcodon Mar 26 '26
Toying around with iceberg branch feature where we have a stage branch that promotes into main after validation
2
u/No-Theory6270 Mar 26 '26
Row count checks is an important smell test.
You need to distinguish between repetible ETLs vs one-offs.
If they are repetible, you need to check the first batch executions manually, and then you expect that from that point on it will behave in the same way. Then you can control row counts and load times regularly.
Schema checks don’t make much sense because if they don’t match the expected format you’ll get an error anyway.
Always create jobs that are idempotent, and use CREATE TABLE IF NOT EXIST and INSERT INTO.
3
u/TorresMrpk Mar 26 '26
I took the hardest route, which was learning the domain as well as I could, many times in my own free time. For example, as a SQL/C# developer, I read several medical billing and coding books, so I could learn health care data very well. It wasn't easy though because most times management wants it done ASAP, which tempts you to just not QA it thoroughly and say it’s done.
1
u/Advanced_Yellow_2547 Mar 28 '26
I wrote a python script that ran both my SQL and big query scripts, and had it spit out a three tab spread sheet that gave 1. Total case volume of each report, 2. Specific case break outs for SQL and 3. Specific breakouts for big query. Then if any data mismatched (it always did), hunting down differences was super easy.