cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Community Discussions
Connect with fellow community members to discuss general topics related to the Databricks platform, industry trends, and best practices. Share experiences, ask questions, and foster collaboration within the community.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

[TABLE_OR_VIEW_ALREADY_EXISTS] when running create or replace view

claudiazi
New Contributor II

When I'm running `dbt run -s model` for different models in parallel on databricks general compute cluster. Im getting the error: TABLE_OR_VIEW_ALREADY_EXISTS. Also, at the same time, the view/table was not created at all.

But I run them in sequence, then no such error will show.

Any idea what is causing this?

5 REPLIES 5

raphaelblg
Contributor III
Contributor III

Hi @claudiazi,

It's hard to determine the exact root cause of the issue, but there's a known issue that could lead to the same error. 

If you check CREATE TABLE [USING] - Parameters. You'll be able to see the following note:

 

Databricks strongly recommends using REPLACE instead of dropping and re-creating Delta Lake tables.

This is because the pattern of deleting and creating Delta Lake tables without the REPLACE clause might not clean-up all the metadata files right away. 

 

Best regards,

Raphael Balogo
Sr. Technical Solutions Engineer
Databricks

claudiazi
New Contributor II

@raphaelblg thaanks a lot for your reply! However the command were `create or replace view/table` Thats why I'm very surprised that we are getting this error message ๐Ÿค”๐Ÿค”๐Ÿค”

 

@claudiazi Are you the owner of the view?

 

Best regards,

Raphael Balogo
Sr. Technical Solutions Engineer
Databricks

claudiazi
New Contributor II

@raphaelblg yes! Im the owner. However, these views are inside the hive_metastore catalog. Could it be the reason?
Many thaaanks!

@claudiazi from what we've discussed so far I see no reason for the failure. 

Not sure if this error is something the community can help with but maybe opening a support ticket through https://help.databricks.com/s/ might be a good idea.

Where's this query being submitted? Interactive cluster, SQL Warehouse, dbt?

 

Best regards,

Raphael Balogo
Sr. Technical Solutions Engineer
Databricks
Join 100K+ Data Experts: Register Now & Grow with Us!

Excited to expand your horizons with us? Click here to Register and begin your journey to success!

Already a member? Login and join your local regional user group! If there isn’t one near you, fill out this form and we’ll create one for you to join!