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

Delta Optimistic Transactions Resolution and Exceptions

User16783853501
New Contributor II
New Contributor II

What is the best way to deal with concurrent exceptions in Delta when you have multiple writers on the same delta table ?

2 REPLIES 2

aladda
Honored Contributor II
Honored Contributor II

Delta operations that can result in a conflict with multiple writers can be found here - https://docs.databricks.com/delta/concurrency-control.html#write-conflicts.In all cases marked โ€œcan conflictโ€, whether the two operations will conflict depends on whether they operate on the same set of files. You can make the two sets of files disjoint by partitioning the table by the same columns as those used in the conditions of the operations

As a general rule the ideas would be the defined your predicates in such a way that concurrent writers operate on different partitions/files of a delta table to avoid concurrent write exceptions

sajith_appukutt
Honored Contributor II

While you can try-catch-retry , it would be expensive to retry as the underlying table snapshot would have changed. So the best approach is to avoid conflicts using partitioning and disjoint command conditions as much as possible.

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.