cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Databricks Lakebridge: Azure SQL DB to Databricks (Error while import)

shubham007
New Contributor III

error_recon.png

Hi community experts,

I am getting error "cannot import name 'recon' from 'databricks.labs.lakebridge.reconcile.execute'" importing modules as shown in attached screenshot. I am follwing steps as mentioned in your partner training module "Lakebridge for SQL Source System Migration". Please help to resolve this issue.

9 REPLIES 9

szymon_dybczak
Esteemed Contributor III

Hi @shubham007 ,

They made refactoring to that module in last month so that's why it stopped working. Probably Lakebridge for SQL Source System Migration module was recorded before that change.

And why they made change? It is explained here:

szymon_dybczak_0-1756815104306.png

Split recon execute into smaller modules (#1892) ยท databrickslabs/lakebridge@7caba7a ยท GitHub

So now the correct way to use this module is like this:

lakebridge/docs/lakebridge/docs/reconcile/index.mdx at 7caba7a3d6d96850f7b9662307ebdaad392bfc80 ยท da...

 

from databricks.labs.lakebridge import __version__
from databricks.sdk import WorkspaceClient

from databricks.labs.lakebridge.reconcile.trigger_recon_service import TriggerReconService
from databricks.labs.lakebridge.reconcile.exception import ReconciliationException

ws = WorkspaceClient(product="lakebridge", product_version=__version__)


try:
  result = TriggerReconService.trigger_recon(
            ws = ws,
            spark = spark, # notebook spark session
            table_recon = table_recon, # previously created
            reconcile_config = reconcile_config # previously created
          )
  print(result.recon_id)
  print(result)
except ReconciliationException as e:
    recon_id = e.reconcile_output.recon_id
    print(f" Failed : {recon_id}")
    print(e)
except Exception as e:
    print(e.with_traceback)
    raise e
    print(f"Exception : {str(e)}")

 

Hi community experts,

I am getting error while Data and Schema Validation with the Reconciler. As attached here screenshots. Please help resolve this issue.

shubham007_0-1756969442961.png

Output:

shubham007_1-1756969493574.png

shubham007_0-1756969649236.png

shubham007_1-1756969678992.png

 

 

 

 

szymon_dybczak
Esteemed Contributor III

HI @shubham007 ,

Are you sure you configured it correctly?

szymon_dybczak_0-1756972818321.png

 

Regarding which configuration ? I have created scope and secrets correctly. You mean about โ€œdatabricks labs Lakebridge configure-reconcileโ€ ?

szymon_dybczak
Esteemed Contributor III

I think you have mistake in your config file. Do you have a NONE catalog? I guess you don't have, so something went wrong during configuration phase:
NONE.SalesLT.customer

Did you follow this guide?

Reconcile Guide | Lakebridge

I am following that guide only. My recon_config_file as below:

shubham007_0-1756979896716.png

and given below parameters while configuring reconcile:

shubham007_1-1756980052893.png

 

 

szymon_dybczak
Esteemed Contributor III

Could you send me link to a guide you're using? I'll try to recreate your scenario then

https://partner-academy.databricks.com/learn/courses/4326/lakebridge-for-sql-source-system-migration...

https://databrickslabs.github.io/lakebridge/docs/reconcile/

My Azure SQL DB:

connection string: jdbc:sqlserver://sqldb.database.windows.net:1433;database=sqldb;user=sqladmin@sqldb;password={your_password_here};encrypt=true;trustServerCertificate=false;hostNameInCertificate=*.database.windows.net;loginTimeout=30;

Target-Databricks:

here need to migrate tables:

shubham007_0-1756980711521.png

 

 

Hi @szymon_dybczak , which type of .sql scripts are required for migration such as legacy metadata and INSERT scripts to populate data in respective tables ?