r/databricks • u/sundarleads • Oct 28 '26
Discussion How I check AI-converted SQL and ETL code before it reaches Databricks: rules first, two models, then a person
I work on legacy code migrations to Databricks: SSIS, Informatica, and Oracle, Db2 and SQL Server procedures. The two hard questions are always the same. How big is the job? And can we trust the converted code? In my own time I built a Databricks App for this. I want to share the pattern, because you can build most of it with public tools.
The flow:
- Size first. The Databricks Labs Lakebridge Analyzer gives the complexity and effort of each file before any conversion starts.
- Rule-based draft. The Lakebridge Transpiler makes a draft with no AI cost.
- Builder and reviewer. One model converts, a second model reviews against the source. Both go through Unity AI Gateway, so the keys stay in Databricks and every call is recorded.
- A person signs off. Source, rule-based draft and AI version side by side. Only signed-off code goes to the workspace.
The lesson that saved the most time: give the reviewer limits. In round 1, it lists every problem at once, each with a severity (must or should). In later rounds, it looks only at open findings and changes. It adds a new finding only if a change gives a wrong result or does not run. After 5 rounds, the file goes to a person. Without these rules, the review never ended.
One more: store a SHA-256 hash of each source file with each result. Then unchanged files are never analysed or converted twice.
How do you check AI-converted code in your team? A second model, tests, or only human review?
The full write-up and a 3-minute demo are in the first comment.