You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The reason you are seeing this probably due to poor documentation on our end :( ...
The build() method just sets up the table, but does not yet actually load the table state. What happens then is that each individual transaction tries to create a new table (v0), which would include the protocol metadata action. On trying to commit it sees the version already exists and conflict resolution kicks in. Writing new data to a table when the protocol was changed by a concurrent transaction (which the conflict checker thinks happened) is an illegal operation.
So in the first case build is what you want, in subsequent calls you need to load the table state via .load().await, rather then build().
The write operation actually also returns the updated table instance, so you do not have to re-load entire state every time when you do multiple operations in a row..
something like
asyncfnmain(){let table = DeltaTableBuilder::from_uri("./data/table3").build().unwrap();println!("version: {}", table.version());// First transactionlet data = get_data(1,10);let table = DeltaOps(table).write(vec![data]).await.unwrap();println!("version: {}", table.version());// Second transactionlet data = get_data(11,15);let table = DeltaOps(table).write(vec![data]).await.unwrap();println!("version: {}", table.version());// Third transactionlet data = get_data(16,30);let table = DeltaOps(table).write(vec![data]).await.unwrap();println!("version: {}", table.version());}
Environment
Delta-rs version: 0.13.0
Binding:
Environment:
Bug
I have this Python code that executes 3 insert transactions into a delta table
This does what is intended. When I run this code, I can confirm by checking the
_delta_log
that indeed 3 transactions was executed.Now I am trying to do similar using Rust, with the following code
But when I run this, it fails with the following error
I noticed the first transaction is executed and this error happens on the second write to the delta table.
The text was updated successfully, but these errors were encountered: