Data and AI: Not that Easy as You Think
In this issue13 min left
Hey friends!👋
Ask AI for a website today, and you get an amazing one in minutes. It is a super designer.
Then I let it into my data projects, and it was a different story.
Working with data is not like making a website, or a fancy AI dashboard. It goes way deeper than that.
And here I am not talking only about analytics, or only about engineering. I mean the whole work with data.
So here are the five challenges I see, and after that, how to work with AI on data anyway.
Let’s go.
Challenge 1: The mistakes are silent
Let’s say AI builds you a website, and it makes a bug, like a wrong color or a broken button.
You see it immediately, you fix it, and you are done.
Data does not work like that. And to be honest, this problem is older than AI.
Before AI: Our pipelines were already hiding mistakes. A pipeline runs successfully, everything is green, and the data is wrong.
- One wrong inner join: It removes a massive amount of rows from the result, and you don’t even get a small notification.
- One wrong filter: It takes a few rows too many or too few, and the total still looks normal.
- Rows that arrive twice: Nobody sees the duplicates, and the revenue is counted double.
- The mistake travels: One pipeline feeds the next and then the dashboard, and the wrong number goes with it.
And mostly we found out from an angry customer.
With AI: Now we also have AI that builds the pipeline, runs it, and reports that everything is green and perfect.
And when I check, it is still wrong. Often it is not even the join, it is a wrong or a missing filter.
It even invents row counts and table sizes, with full confidence. A good engineer always doubts: let me double-check that join.
AI never says “I’m not sure about this number.”
A wrong button is just a bug. But a wrong number leads the business to a bad decision.
Challenge 2: AI needs the data and the domain knowledge
To build any data project, you need two things: the data and the domain knowledge.
Without them, you can build a beautiful Power BI report with wrong numbers, a pipeline that is all wrong, or a bad data model.
The domain knowledge is everything the data does not tell you:
- The definitions: What counts as an active customer?
- The rules: Is the revenue with the returns or without them?
- Where it lives: You don’t find it in a column name. It is in the documents, and mostly in the heads of the people.
And it is the same for AI. If you don’t feed it the data and the domain knowledge, there is no way it works.
Here is one big problem:
- Many customer tables: You have many tables, and all of them hold customers. Each one comes from another source and another process.
- AI guesses: Which one is right for your query? Mostly AI guesses, so it targets the wrong tables and does wrong joins.
- You have to know: Only real knowledge of the processes and the sources tells you which tables are the right ones.
And on top of that, many companies, especially the big ones, do not allow the advanced AI models. They don’t let their data and their domain knowledge travel outside the company.
The real question is not “can AI write SQL”. It is “can AI understand the whole company”.
Challenge 3: AI never learned from real data projects
Now you might ask: why is AI so good at websites and so weak at data projects?
Look at what it learned from. The internet is full of websites, and AI could learn from all of them.
Now go to GitHub and search for a real data lakehouse. You find one or two, and they are toys.
The real data projects live inside the companies, and nobody publishes them. So AI never saw one from the inside.
And a real project looks nothing like a demo. The demos online run on five clean tables with perfect metadata.
In one of my projects, we spent three years connecting ten sources with more than 1,200 tables.
And I challenged it with five data engineering projects. What came back was just expensive, over-engineered, and not even relevant.
Yes, AI is a super designer, it builds amazing websites. But let it build a real data project, and it is still garbage.
Challenge 4: The bill explodes
This one is simple. It is just expensive.
A person writes a query, looks at the result, thinks, and then writes the next one. AI does not work like that.
It sends query after query to find its way through your data, thousands of them.
And on a cloud platform, you pay for every query. I know people who use AI on their data platform, and the bill is just exploding.
- It does not think about your bill: It ignores the partitioning and the costs, unless you force it.
- A bad query, again and again: It scans terabytes each time, and the bill goes into thousands of dollars.
- Trying is not free: In coding, AI runs a test, fails and tries again, and it costs almost nothing. In data, every try is a query on the real platform.
A junior with AI can spend a whole cloud budget in one day.
Challenge 5: The single point of truth is gone
For years, we data people fought for one thing: the single point of truth.
It means one place for the data and one definition for each number, and the whole company uses it.
Before AI: The problem was Excel. Everyone had their own sheet with their own numbers, and a data warehouse with one data model was our answer.
With AI: Now everyone asks their own question in their own chat, and everyone gets their own number.
- The same revenue: Two people ask for it, and the AI writes two different queries.
- Again tomorrow: You ask the same question, and you can get a different answer.
- Everyone builds: People build a dashboard in one afternoon, with its own logic inside, and nobody else knows that logic.
And then they sit in one meeting with three different numbers for the same revenue, and nobody knows which one is right.
The single point of truth is totally destroyed. It does not exist anymore.
So it is all about trust
So after all of this, for me it is now all about trust. Can I trust this number?
With an app, if it works, nobody cares how it was built. But with data, everything we build is built on trust.
And if the business users lose it, it is very hard to gain it back.
- Excel is back: They go back to their own sheets.
- Every day: They write you that your data is wrong, even when it is right.
- In regulated work: “The AI wrote it and nobody checked” does not survive an audit.
It might even be the end of your data project.
AI can build the pipeline. But somebody has to stand behind the number, and that is still me.
And there is a second question, before you even start: does your company allow you to use the tool?
Because with data, the AI does not only read your code. It reads your customers, your prices and even your salaries.
So check the rules of your company before you put anything into an AI tool. And never paste company data into your private account.
Start with the work around the data
Now you might say, okay, then I stop using AI for data. But no, I use it every day, just not to build the whole project.
And one rule decides what AI gets: hand over only what you know how to check. If you could not do the task yourself, you cannot really check the result.
So start with the things around you that have nothing to do with the numbers.
For example the documentation that nobody wants to write, or the search through the logs when a pipeline fails.
Automate those first. If the AI gets one of them wrong, the damage is small, and you have time to check it.
Then build tools that make you fast. Here are four that I built with AI:
- Profiling a new source: The format, the schema, the nulls and the duplicates, before I build anything.
- Investigating an incident: It reads the logs and finds the root cause. The decision is mine.
- The metadata: The tables, the columns and the types come from the data, the descriptions from the documents, and what is unknown stays empty.
- Data lineage: I click a table and see where its data comes from and what depends on it.
I show all of them in this video: How I Use Claude Code as a Data Engineer.
AI is profiling, documenting and investigating, and I am the one who decides.
Metadata first, then the semantic layer
AI needs the domain knowledge, and the company needs its single point of truth back. For both, somebody has to write the knowledge down.
- Metadata first: What every table and every column is, where it comes from, and which table is the right one.
- Then the semantic layer: One place where every number is defined once: what revenue means, what an active customer is, how the tables join.
When people and AI use the same definitions, the same question gets the same number again.
And if you have a solid semantic layer today, you have a big head start with AI. I saw it myself: the lakehouses I had built for BI suddenly became the core of every AI project in the company.
But two things:
- You own the definitions: AI can draft the descriptions, but which table is right and what a number means is your decision.
- Keep it up to date: When a table or a definition changes, its description changes in the same step. Old documentation makes AI worse, and it happens silently.
Metadata is the new bare minimum. If you don’t provide it, the AI use case fails.
Make as many quality checks as you can
The mistakes in data are silent, so you need checks that catch them for you.
And “I will review it” is not enough. The better AI gets, the less we check.
When AI made many mistakes, we checked everything. Now it makes fewer, and we stop looking.
So make quality checks, as many as you can. And here AI really helps, because it writes checks for every column in minutes.
- Row counts: Count the rows before a join and after it. If rows disappear or double, you want to know.
- Duplicates: Check that the primary key is unique.
- Nulls: Look for missing values, and for columns that are completely empty.
- Values out of range: Catch a negative price, or an order date in the future.
Three rules make these checks worth something:
- You define what correct means: The AI only writes the check for it.
- A check stops the pipeline: A warning is not enough, because a warning does not fail the run.
- A failing check stays as it is: The AI is not allowed to change it. It fixes the cause.
And test the check itself. Break the data on purpose once, and see if the check catches it.
Nobody can read every line, so my trust comes from the checks.
Never let AI guess a number
Now the numbers themselves. I have two rules here.
Rule 1 AI never guesses a number
AI does not calculate. It predicts the next word.
So a number from its head can be invented, and it looks exactly like a real one.
It must use SQL or Python to find the number in the data. And it has to show you the query or the code, so you see how the number was made.
If it cannot find the number, the answer stays empty, because an invented number is way worse than no number.
Rule 2 Always calculate a number from AI in two different ways
One calculation can hide a wrong filter or a wrong join. But it is very unlikely that two different calculations hide the same mistake.
- The example: Last month’s revenue, once from the table behind your report and once from the source, with filters you write yourself.
- Be careful: If one AI builds both ways in one chat, both can share the same mistake.
So one of the two numbers comes from outside the chat: a report you trust, or your own query.
If the two numbers are different, you know something is wrong, and you find it before your customer does.
Two limits for the AI
Two limits, for the problems that checks cannot solve:
- Not on production: Don’t connect an AI agent directly to the production database. Give it a copy or a read-only view.
- Its own budget: Give the AI its own account, with a budget that warns you and a time limit that stops a bad query early.
And the design stays with you: the architecture and the data model are not the job of the AI.
Don’t forget the old way
And finally, the old way: we check our data with our own hands, like we did before AI.
- Pick ten random records: Ten orders, or ten customers. Track each one by hand, from the source system, through the pipeline, to the final report.
- Do your own calculation: Take one number and calculate it yourself, with your own query. This is your rehab: one piece of work without AI.
- Protect the big numbers: Before you publish any report, write queries that validate them: the total revenue, the customers, the orders.
Keep those queries, and run them again every time the report changes.
Ten records are not much. But you see with your own eyes what happens to one order on its way to the report.
And if you never calculate anything yourself, you lose the feeling for the data. Without that feeling, you cannot tell when a number is wrong.
So …
So yes, AI builds amazing websites, and I use it in my data projects every day.
But data is a different story. The mistakes are silent, the AI is always confident, and in the end it is all about trust.
My recommendation: hand over only what you know how to check, and let AI build your tools and your checks.
Give it the metadata and one definition for each number.
Never let it guess a number, and calculate every number from AI in two different ways.
And keep the old way alive: pick ten random orders and track them by hand.
So with AI, the person who really understands the data becomes even more important.
So let AI build, but in the end, you are the one who answers for the number.
Thanks for reading ❤️
Baraa Khatib Salkini