Skip to content

Commit 7039c27

Browse files
Fix snapshot sequence number
1 parent e6b8a35 commit 7039c27

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

iceberg-rust/src/table/transaction/operation.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,11 +208,13 @@ impl Operation {
208208
(_, _) => Ok(SnapshotOperation::Overwrite),
209209
}?;
210210

211+
let snapshot_sequence_number = table_metadata.last_sequence_number
212+
+ if dsn_offset >= 1 { dsn_offset } else { 1 };
211213
let mut snapshot_builder = SnapshotBuilder::default();
212214
snapshot_builder
213215
.with_snapshot_id(snapshot_id)
214216
.with_manifest_list(new_manifest_list_location)
215-
.with_sequence_number(table_metadata.last_sequence_number + 1)
217+
.with_sequence_number(snapshot_sequence_number)
216218
.with_summary(Summary {
217219
operation: snapshot_operation,
218220
other: additional_summary.unwrap_or_default(),

0 commit comments

Comments
 (0)