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:ย 

SQL Warehouse - Table does not support overwrite by expression:

adriennn
Contributor II

I'm copying data from a foreign catalog using a replace where logic in the target table, this work fine for two other tables. But for a specific one, I keep getting this error:

Table does not support overwrite by expression: DeltaTableV2(org.apache.spark.sql.SparkSession@...,abfss://...@....dfs.core.windows.net/__unitystorage/catalogs/.../tables/...,Some(CatalogTable( Catalog: ...Database: ...Table: ...Owner: c... Created Time: ... Last Access: UNKNOWN Created By: Spark Type: MANAGED Provider: delta Table Properties: [delta.checkpoint.writeStatsAsJson=false, delta.checkpoint.writeStatsAsStruct=true, delta.columnMapping.maxColumnId=91, delta.columnMapping.mode=name, delta.enableChangeDataFeed=false, delta.lastCommitTimestamp=1700647538000, delta.lastUpdateVersion=0, delta.minReaderVersion=2, delta.minWriterVersion=5]

Anybody has seen this before? I tried deleting the table, creating using another name, nothing works. Seems there either is some issue with field names or maybe something in the data? The table copies fine if I don't use the replace where logic in the query.

fails

insert into mycatalog.mydb.mytable
replace where myfield >= {{ pipeline param }}
select * from myforeigncatalog.mydb.mytable;

works
insert into mycatalog.mydb.mytable
select * from myforeigncatalog.mydb.mytable;



2 REPLIES 2

adriennn
Contributor II

Thank you for the checklist @Retired_mod,

> Review and validate the replace where expression.

I was using dateadd() with a pipeline parameter, dateadd() returns a timestamp, which was being compared against a date column which threw the error.

Thanks @Retired_mod of course this is what I did.

But I think the bottom line of this issue is the unclear error message, which clearly states that the target delta table is incompatible, when the error is clearly on the source side.

A.

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