Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
c-thiel committed Nov 13, 2024
1 parent acbbbdf commit 47270f7
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions crates/iceberg/src/spec/table_metadata_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,22 +312,8 @@ impl TableMetadataBuilder {
/// - No partition spec has been added to the table metadata.
/// - No sort order has been added to the table metadata.
/// - Snapshot id already exists.
/// - For format version > 1: the sequence number of the snapshot is loser than the highest sequence number specified so far.
/// - For format version > 1: the sequence number of the snapshot is lower than the highest sequence number specified so far.
pub fn add_snapshot(mut self, snapshot: Snapshot) -> Result<Self> {
if self.metadata.partition_specs.is_empty() {
return Err(Error::new(
ErrorKind::DataInvalid,
"Attempting to add a snapshot before a partition spec is added",
));
}

if self.metadata.sort_orders.is_empty() {
return Err(Error::new(
ErrorKind::DataInvalid,
"Attempting to add a snapshot before a sort order is added",
));
}

if self
.metadata
.snapshots
Expand Down

0 comments on commit 47270f7

Please # to comment.