cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
cancel
Showing results for 
Search instead for 
Did you mean: 

source db and target db in DLT

alj_a
New Contributor III

Hi,

Thanks in advance.

I am new in DLT, the scenario is i need to read the data from cloud storage(ADLS) and load it into my bronze table. and read it from bronz table -> do some DQ checks and load the cleaned data into my silver table. finally populate the data into gold table which is dimensioanl model.

i tried it and everyhting is working. but all the tables are getting created and populated in single database in hive metastore.

what im looking for is, i already have three databse(schema) like bronze_db, silver_db and gold_db. but i am stuck in how to specify the database name or schema name in dlt.

#Load only latest file to Bronze table from landing zone
@dlt.create_table(
  comment="The raw leads data, ingested from ADLS landing zone.",
  table_properties={
    "dlt_lead.quality": "bronze",
    "pipelines.autoOptimize.managed": "true"
  }
)
def leads():
    #return (spark.readStream.csv(file_location, header=True))
  return df_bronze_leads
this table should be created under bronze databse/schema
2 REPLIES 2

Kaniz
Community Manager
Community Manager

Hi @alj_aIn Delta Live Tables (DLT), the database or schema name is specified in the table name itself. You can specify the database name in the @dlt.table decorator by using the format database_name.table_name.

alj_a
New Contributor III

Thank you Kaniz. 

I tried and got the error.

"Please remove the database qualifier from table"

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.