r/databricks • • 5d ago

Help Question for Databricks engineers and data architects:

For those who have migrated workloads from Oracle to Databricks, how much effort goes into rewriting existing SQL queries?

A few things I’d love to understand:

● Is SQL translation a significant bottleneck in migration projects?
● Do you currently rely on manual rewriting, AI assistants, or commercial migration tools?

14 Upvotes

18 comments sorted by

19

u/Muted_Jellyfish_6784 5d ago

SQL translation is rarely the bottleneck people expect. Tools and AI assistants handle most of the syntax, but PL/SQL packages, implicit date and NULL handling, sequences, and MERGE semantics are where the hours go, and those need someone who knows what the business logic was supposed to do.
The useful habit is reconciling outputs, not just getting queries to run: row counts, sums on key measures, and record-level diffs for every migrated object. We run a decision intelligence platform that joins both sides by business key during parallel runs, so a mismatch traces back to one transformed table instead of a final report that just looks off.

1

u/casmanrojo 5d ago

So the syntax is translating cleanly but the numbers are coming out different?

Curious about the reconciliation part, is that something you built in-house or is there tooling for it?

1

u/Muted_Jellyfish_6784 5d ago

Good question. We use an existing decision intelligence platform called SIGNLD. The idea is to connect the source and migrated data through shared business keys, then make it easier to trace differences and understand their impact. It's less about replacing Databricks and more about adding visibility across the data and business outcomes. I work with SIGNLD, so I'm familiar with the platform

3

u/Additional_Future_47 5d ago

Databricks supports a lot of the Oracle dialect but in our migration project we data engineers decided to use the opportunity to restructure our processing and the business also wants to redefine certain reports and KPIs so in practice it is manual SQL with occasionally some AI support.

1

u/casmanrojo 5d ago

Ok but, how did you handle the really big ones? We've seen queries in the 100k character range or more with nested logic that nobody fully remembers, and rewriting those by hand seems brutal. Did you break them up, rebuild from scratch?

2

u/Additional_Future_47 5d ago

There is no point in re-writing queries if you don't understand what they are supposed to do. These queries are a good reason to go back to the business to clarify the requirements first and then go back to the code. And SQL can be very verbose, especially when it is generated by some etl tools, but once you understand the logic, the actual size in text doesn't matter much anymore. Oh, and we use temporary views or ctes to break up logic in logical chunks.

2

u/Whit3boy316 5d ago

I moved sas programs to databricks (and Altair) in a couple days…..and by “I”, I mean AI

1

u/Zealousideal_Low6685 5d ago

not sure if you only talk about read queries. If not, there are still several conceptual differences:
* Databricks uses WriteSerializable by default + Optimistic Conurrency
* Databricks multi-statement transaction were just released

1

u/mecurioj 5d ago

Look into Lakebridge to help. However, PL/SQL can have procedural "programming" statements that don't have standard ANSI SQL equivalent statements. Lakebridge can help you evaluate before conversion how complex the migration of code will be.

1

u/PriahGTM 5d ago

I thought you just map out the full system schema and then just tell Claude to move that shit into Databricks at this point.

Walk away. And then when you come back it will basically be done.

What am I missing?

1

u/Anil_PDQ 5d ago

This is actually a great way to learn PostgreSQL through real-life applications. You can start with separate tables for income, expenses, budgets, and personal projects, then use SQL queries to analyze spending patterns and track progress. Just remember to secure sensitive financial data with encryption, strong authentication, and regular backups. Practical projects are one of the best ways to build database skills!

1

u/DarkQuasar3378 4d ago

I think how project is structured and modularized play a big part in conveying and translating successfuly to a new platform. Also how well the project is designed to serve its purpose is important.

I helped migrated some BI dashboards from Looker Studio to Databricks (while building company's self-service platform) and it was a nightmare. Reason was that existing dashboards were designed around Looker's primitives and not as a well-structured software. One single query stuffed with nested queries that I'd to breakdown.

But in all this most of effort went into planning.

Databricks may offer features that could simplify your existing queries and you may have to rewrite to reap benefits.

1

u/boganmax666 4d ago

one area worth exploring is how much of the migration effort can be reduced through automation rather than treating every oracle query as a manual rewrite. particularly with PL/SQL, stored procedures, and oracle specific functions, the challenge is preserving business logic while translating it into spark sql efficiently have you experimented with accelerators that automate ODI/SQL to Spark SQL conversion, followed by validation and performance tuning? curious how much they actually reduce migration timelines in real-world projects.

1

u/Fancy-Cress-925 1d ago

SQL translation can be done easy and get Oracle SQL running on Databricks fast.

The real risk is code that runs fine but quietly returns different numbers (NULLs, dates, decimals).

That's why we built our tool it converts Oracle and Informatica to Databricks, then compares old vs new outputs and traces every difference to its cause, so you can prove results match before cutover.

1

u/Snoo-37224 23h ago

Hey
● Is SQL translation a significant bottleneck in migration projects?
Code migration is one part of the job, you must also consider data types mapping, data reconciliation, support of objects not (currently) supported - like SEQUENCE, User defined data types etc.
And even in the code migration itself, the way you will deal with a SQL-92 compliant SQL query, or a PL/SQL object that uses intensively vendor lock-in features of oracle (Supplied PLSQL package calls like DBMS_x, UTL_x packages call) will not generate the same level of effort. Hopefully AI can help you for that and you can use Genie Migrate within Databricks to facilitate the job ... but you'll have to validate the migrated code will generate the same business conistency. The nightmare will be an Oracle database that use external C/C++ compile library with no code available ... in such case, it will probably be a nightmare to migrate !

● Do you currently rely on manual rewriting, AI assistants, or commercial migration tools?
All of them, with a growing part of AI based conversion tool. The best tool I would recommend is Genie Migrate, it's integrated a fully compliant with the Databricks technology. BUT, the most important thing I see to that is usually unconsidered ... once the code has been migrated, whatever the tool/technology/human used ... it requires a business consistency validation. In other words, an ETL package will have to generate the same data whatever the language. This has to be validated and someone in the org has to be accountable for validating such conversion. It could be agents or humans, but in this specific area, as of 2026, the major part of validation is made by humans.

1

u/ThreeBricksWish Databricks 15h ago

Agree with the top comment: syntax conversion is the easy part. The hours go into PL/SQL packages, implicit date/NULL behavior, MERGE semantics, and proving the numbers match.

On the 100k-character queries nobody remembers: that's where an agent that can actually run code helps. Instead of rewriting blind, have it execute the original logic in chunks (temp views or CTEs per logical section), explain what each section does, and compare row counts and key-measure totals against Oracle as it goes. You get documentation and a test harness as a byproduct.

Reconciliation is the same story: row counts, sums on key measures, record-level diffs per migrated object are tedious and mechanical, exactly the work an agent can write and run while a human reviews the exceptions.

Full disclosure, I work on Genie at Databricks (Genie Code, the coding agent in notebooks and the SQL editor). The workflow I see the most is convert first using Genie Migrate, or Lakebridge to assess PL/SQL complexity, then iterate and debug the output in the notebook against real data.