Brahmareddy
Esteemed Contributor II

Hi Victor,

How are doing today?, As per my understanding, Yeah, this seems like expected behavior, but it's definitely not well-documented. When you create a Materialized View (MV) in Databricks, it automatically sets up a DLT (Delta Live Tables) pipeline behind the scenes to manage and refresh the view. Even if the query times out or fails, Databricks still creates internal resources, like the MV metadata (__staging__accounts_{hash}__) and the DLT job, which can continue running and incurring costs unless manually cleaned up. Unfortunately, there isn’t a built-in way to detect failed MV creations easily.

To avoid this in the future, you might want to test your query separately before using it in an MV and monitor system tables (information_schema.materialized_views) for any unexpected MVs. If you notice unwanted resources, you’ll need to manually drop the MV and stop the DLT job. It would be great if Databricks had a clearer way to notify users when an MV creation fails but still leaves behind resources—maybe worth raising a support ticket for better documentation. Let me know if you need help cleaning up those resources!

Regards,

Brahma