cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Community Platform 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?

1 ACCEPTED SOLUTION

Accepted Solutions

raphaelblg
Honored Contributor II
Honored Contributor II

@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

View solution in original post

5 REPLIES 5

raphaelblg
Honored Contributor II
Honored Contributor II

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 ๐Ÿค”๐Ÿค”๐Ÿค”

 

raphaelblg
Honored Contributor II
Honored Contributor II

@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!

raphaelblg
Honored Contributor II
Honored Contributor II

@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

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