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

AnalysisException: is not a Delta table.

joselita
New Contributor III

STG_DATA_LOADHello,

I changed the DBR from 7.2 to 10.4 and I receive the following error: AnalysisException: is not a Delta table.

The table is create , using DELTA. so for sure is a Delta table, even though, I read that I read that from vers. 8 all tables are Delta as default and don't need to write USING DELTA.

What can say me about this error?

AnalysisException: `default`.`stg_data_load` is not a Delta table.;

---------------------------------------------------------------------------

AnalysisException                         Traceback (most recent call last)

<command-4355583460198494> in <module>

     49

     50 # Fill staging table

---> 51 df.write.insertInto('STG_DATA_LOAD', overwrite = False)

/databricks/spark/python/pyspark/sql/readwriter.py in insertInto(self, tableName, overwrite)

   1147         if overwrite is not None:

   1148             self.mode("overwrite" if overwrite else "append")

-> 1149         self._jwrite.insertInto(tableName)

   1150

   1151     def saveAsTable(self, name, format=None, mode=None, partitionBy=None, **options):

/databricks/spark/python/lib/py4j-0.10.9-src.zip/py4j/java_gateway.py in __call__(self, *args)

   1302

   1303         answer = self.gateway_client.send_command(command)

-> 1304         return_value = get_return_value(

   1305             answer, self.gateway_client, self.target_id, self.name)

6 REPLIES 6

Ryan_Chynoweth
Honored Contributor III

Hi @JOSELITA MOLTISANTI​ can you run the following commands and share the output?

table_name = "stg_data_load"
path = spark.sql(f"describe detail {table_name}").select("location").collect()[0][0].replace('dbfs:', '')
dbutils.fs.ls(path)

Mnt/.../RAW/community/datalog

Ryan_Chynoweth
Honored Contributor III

Hi @JOSELITA MOLTISANTI​, It should look more like the following. I am interested in seeing the contents of the path not the path itself.

image

Ryan_Chynoweth
Honored Contributor III

Also, it would be more helpful if you could provide code snippets as well. I see you are trying to do the write.insertInto command.

Kaniz
Community Manager
Community Manager

Hi @JOSELITA MOLTISANTI​​, We haven’t heard from you since the last response from @Ryan Chynoweth​, 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.

Kaniz
Community Manager
Community Manager

Hi @JOSELITA MOLTISANTI​, I wanted to share this S.O thread with you which is similar to the issue mentioned here by you. Please have a look and revert back if you were able to resolve your issue.

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.