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: 

Bug - Cannot create table The associated location is not empty and also not a Delta table.

gilo12
New Contributor III

I am getting the error:
Cannot create table ('`hive_metastore`.`MY_SCHEMA`.`MY_TABLE`'). The associated location ('dbfs:/user/hive/warehouse/my_schema.db/my_table') is not empty and also not a Delta table.

When running 

drop table 'hive_metastore`.`MY_SCHEMA`.`MY_TABLE`
Getting 
[TABLE_OR_VIEW_NOT_FOUND] The table or view `hive_metastore`.`MY_SCHEMA`.`MY_TABLE` cannot be found. Verify the spelling and correctness of the schema and catalog.

How Can I over that can error? I also tried "create of replace table"  but still getting the original error
location is not empty
2 REPLIES 2

Hemant
Valued Contributor II

Hi @gilo12  delete the table data if not important from the above location `dbfs:/user/hive/warehouse/my_schema.db/my_table' and then create the table it will work.
For deletion use:

dbutils.fs.rm('dbfs:/user/hive/warehouse/my_schema.db/my_table',True)

 

Hemant Soni

Anonymous
Not applicable

Hi @gilo12 

Thank you for posting your question in our community! We are happy to assist you.

To help us provide you with the most accurate information, could you please take a moment to review the responses and select the one that best answers your question?

This will also help other community members who may have similar questions in the future. Thank you for your participation and let us know if you need any further assistance! 

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