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!

@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