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: 

Difference @dlt.table and @dlt.create_table decorator

RaccoonRadio
New Contributor

Hi!

I'm currently trying to stream data from an Azure Event Hub (kafka) using DLT. The provided example (https://learn.microsoft.com/en-us/azure/databricks/delta-live-tables/event-hubs) works well.

I saw in different examples the usage of two different decorators "@dlt.table" and "@dlt.create_table" but I could not find out which the correct one is. It works with both, also if the table does not exist when starting the DLT-pipeline.

Can anybody tell me which the correct one is and what the differences are?

Thanks!

1 REPLY 1

@Retired_mod , Are you suggesting that the first time a pipeline runs, the below decorator should be used:

 

@dlt.create_table

 

 And the once the pipeline runs, the notebook should be edited to use this decorator:

 

@dlt.table

 

 

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group