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: 

How do I drop a delta live table?

TamD
Contributor

I'm a newbie and I've just done the "Run your first Delta Live Tables pipeline" tutorial.

The tutorial downloads a publicly available csv baby names file and creates two new Delta Live tables from it.  Now I want to be a good dev and clean up the resources so they aren't cluttering up the environment.  However, I can't find docco for dropping delta live tables.  You can't just drop them separately, because you get an error:

[STREAMING_TABLE_OPERATION_NOT_ALLOWED.DROP_DELTA_LIVE_TABLE] The operation DROP is not allowed: The operation does not apply to Streaming Tables created from Delta Live Tables, instead remove the Streaming Table from the pipeline definition in Delta Live Tables.

I removed the definitions of the two tables from the pipeline definition (per the above error), but then I get the error:

[DLT ERROR CODE: NO_TABLES_IN_PIPELINE] You attempted to update an empty pipeline. This error usually means no tables were discovered in your specified source code. Please verify that your source code includes table definitions.

What is the correct way to remove unwanted Delta Live Tables?

6 REPLIES 6

filipniziol
Contributor III

Hi @TamD ,

1. Delete the DLT Pipeline
2. Delete the delta tables created by DLT Pipeline

Hi @filipniziol  thank you for replying.  Have you confirmed that your method works?  And if you have, could you please provide more detail for the "delete the delta tables" part?  As I describe above, attempting to drop the tables outside of the pipeline results in an error.

gchandra
Databricks Employee
Databricks Employee

As DLT is a declarative coding, the pipeline is tightly coupled with the DLT table. 

Deleting the pipeline or removing that particular table from the pipeline and rerunning it will remove the DLT table. 



~

Deleting the DLT pipeline should delete the underlying data files, too. But as DLT tables / materialized views don't show us their ID or storage location, it is not trivial to find them and to make sure they are actually removed from storage right away or there is an intentional latency (e.g. 7 days as for delta tables).

See similar thread here: https://community.databricks.com/t5/data-engineering/where-are-materialized-view-generated-by-delta-...

Hi, @filipniziol 

One help, I have a doubt, how can i delete a delta tables created by DLT Pipeline if i haven't more acess to pipeline, the workspace is unaccessible.

TamD
Contributor

Thank you @gchandra .  Deleting the pipeline does indeed remove the materialized view definitions from the Catalog.  How can I confirm that the underlying S3 storage has also been cleared?  Just removing the pointers in the Catalog is not enough, if it leaves orphaned resources in cloud storage.  

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