cancel
Showing results for 
Search instead for 
Did you mean: 
Get Started Discussions
Start your journey with Databricks by joining discussions on getting started guides, tutorials, and introductory topics. Connect with beginners and experts alike to kickstart your Databricks experience.
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! 

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local community—sign up today to get started!

Sign Up Now