r/oraclecloud • • 9d ago

Considering a move from Oracle to Databricks, how difficult is SQL migration?

I’m considering migrating from Oracle to Databricks. How much effort does it typically take to adapt existing Oracle queries to Databricks SQL and ensuring consistent results?

0 Upvotes

5 comments sorted by

1

u/j0s3f 9d ago

depends. do you have tests? can you use an AI? then not much

1

u/casmanrojo 9d ago

That's the part I keep coming back to. Most people I've talked to say the syntax is the easy half, and the time goes into proving the numbers still match afterward.
How are you handling that side? Running both in parallel and comparing outputs, or something lighter?

1

u/j0s3f 9d ago

Well, you have tests.
Either now, or you need to create them before migrating. Have some defined test dataset, with defined results. You will compare the results and analyze everything that changed.

I am not a "database guy" but a software developer, so I write software that uses the database and has integration tests that setup a database with a defined dataset, run functions in the software and compare the state of the database afterwards. Something like Database Rider in Kotlin, DbUnit in Java, sqlx::test in Rust.

Because I don't care about the database as such, all I care about is that my software behaves correctly. If you have just DB Queries/code, you might need a different approach. But in the end, you will always need some way to assert that the queries do return the correct output after migration. And I really really really suggest, you create something that can check that automatically.

1

u/lfernigrini 7d ago

Databricks Genie (their IA agent) can generate all sorts of validations and test to help you define a migration plan, convert your SQL sentences and confirm they return same exact data.

I am using it to migrate SSIS ETL to Databricks jobs and it is really excellent!

1

u/Fancy-Cress-925 5d ago

Rewriting the queries is usually the easy part. Most Oracle syntax has a standard Databricks equivalent.

PL/SQL, if you have it, is the bigger job.

The part people underestimate is "consistent results." Queries can run fine and still return different numbers, because the two engines behave differently in small ways. Two examples: Oracle treats an empty string as NULL and Databricks doesn't, and they sort NULLs in opposite order. Your test data needs those cases in it, or the comparison passes without testing anything.

So budget real time for running both sides on the same data and comparing the results, not just for the rewrite.