cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

Incompatible format detected while writing in Parquet format.

KKo
Contributor III

I am writing/reading data from Azure databricks to data lake. I wrote dataframe to a path in delta format using query a below, later I realized that I need the data in parquet format, and I went to the storage account and manually deleted the filepath. Now, when I try to execute query b it always throwing an error c below. I am pretty sure the filepath now does not exists on the storage because I manually deleted it. What is missing here, is this some kind of bug? Thanks in advance!

a) df.coalesce(1).write.format('delta').mode('overwrite').option('overwriteSchema', 'true').save(filepath)

b) df.coalesce(1).write.format('parquet').mode('overwrite').option('overwriteSchema', 'true').save(filepath)

c) AnalysisException: Incompatible format detected.

A transaction log for Databricks Delta was found at `filepath_delta_log`,

but you are trying to write to `filepath` using format("parquet"). You must use

'format("delta")' when reading and writing to a delta table.

2 REPLIES 2

KKo
Contributor III

Update: I tried Clear state and outputs which did not help, but when I restarted the cluster it worked without an issue. Though the issue is fixed, I still don't know what caused the issue to come in.

jose_gonzalez
Databricks Employee
Databricks Employee

Hi @Kris Koirala​,

Thank you for your reply. If you would like to find the RCA of this issue, please go to you driver logs and download the log4j, stdout and stderr logs. These log files will help you to narrow down the RCA and the reason why the error was happening.

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