cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
cancel
Showing results for 
Search instead for 
Did you mean: 

Location not empty but not a Delta table

Distributed_Com
New Contributor III

I need help or insight regarding the following errors. My instructors (Brooke Wenig with Conor Murphy) ran this code successfully on our course video, but I cannot replicate what she did.

Here is the code and below it is the outcome from my Coursera course, workspace section 4.5 notebook:

CREATE DATABASE IF NOT EXISTS Databricks;

USE Databricks;

DROP TABLE IF EXISTS fireCallsDelta;

CREATE TABLE fireCallsDelta

USING DELTA

PARTITIONED BY (City)

AS 

 SELECT * FROM fireCallsParquet

(3) Spark Jobs

  • Job 3 View(Stages: 1/1)
  • Job 4 View(Stages: 1/1, 1 skipped)
  • Job 5 View(Stages: 1/1, 2 skipped)

Error in SQL statement: AnalysisException: Cannot create table ('`spark_catalog`.`databricks`.`fireCallsDelta`'). The associated location ('dbfs:/user/hive/warehouse/databricks.db/firecallsdelta') is not empty but it's not a Delta table

1 ACCEPTED SOLUTION

Accepted Solutions

dennyglee
New Contributor III
New Contributor III

The `fireCallsDelta` table already exists, and it appears it was created as a PARQUET table. A couple of options:

  1. DELETE the original Parquet table as a separate statement (i.e., in a separate cell so it can complete itself before any other jobs executing)
  2. Rename the table to something else if perhaps others are running the same demo.

View solution in original post

6 REPLIES 6

dennyglee
New Contributor III
New Contributor III

The `fireCallsDelta` table already exists, and it appears it was created as a PARQUET table. A couple of options:

  1. DELETE the original Parquet table as a separate statement (i.e., in a separate cell so it can complete itself before any other jobs executing)
  2. Rename the table to something else if perhaps others are running the same demo.

Thanks. Renaming table as you suggested allowed the query to run successfully.

Kaniz
Community Manager
Community Manager

Hi @Dave French​, We haven’t heard from you since the last response from @Denny Lee​ , and I was checking back to see if you have a resolution yet.

If you have any solution, please share it with the community as it can be helpful to others. Otherwise, we will respond with more details and try to help.

Also, Please don't forget to click on the "Select As Best" button whenever the information provided helps resolve your question.

Done. Thanks.

Thank you @Dave French​ ! Keep Learning.

gilo12
New Contributor III

DELETE the original Parquet table as a separate statement

How can this be done? simple query "DROP TABLE .... " still failing with "cannot be found"

 

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.