Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us at FabCon Vienna from September 15-18, 2025, for the ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM. Get registered

Reply
MisterSmith
Helper I
Helper I

Constraints on delta parquet file

All

Is it possible to put constraints on a delta parquet file.  I'm experiencing scenarios where data is duplicating.  On sql server I would have a primary key to manage duplication by erroring.  I have adapted my code to try and prevent duplication.  However in some cases it is due to incorrect data in the source system.  I dont want to hide this and want the error to surface so it can be fixed in the source system.  Therefore can I apply a constraint to a parquet file or do I have to manage this with code?

 

Thanks

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @MisterSmith ,

 

You can use Delta Lake's merge operation to de-duplicate data. This operation allows you to merge new data into an existing Delta table and specify conditions to handle duplicate data.

vkongfanfmsft_0-1730775673664.png

 

You can try sql like below:

MERGE INTO logs
USING newDedupedLogs
ON logs.uniqueId = newDedupedLogs.uniqueId
WHEN NOT MATCHED
  THEN INSERT *

 

For more details, you can refer to below document:

Upsert into a Delta Lake table using merge - Azure Databricks | Microsoft Learn

 

Best Regards,
Adamk Kong

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @MisterSmith ,

 

You can use Delta Lake's merge operation to de-duplicate data. This operation allows you to merge new data into an existing Delta table and specify conditions to handle duplicate data.

vkongfanfmsft_0-1730775673664.png

 

You can try sql like below:

MERGE INTO logs
USING newDedupedLogs
ON logs.uniqueId = newDedupedLogs.uniqueId
WHEN NOT MATCHED
  THEN INSERT *

 

For more details, you can refer to below document:

Upsert into a Delta Lake table using merge - Azure Databricks | Microsoft Learn

 

Best Regards,
Adamk Kong

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June FBC25 Carousel

Fabric Monthly Update - June 2025

Check out the June 2025 Fabric update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.