Skip to content

Commit

Permalink
Merge pull request #12 from relativityone/dont-panic
Browse files Browse the repository at this point in the history
fix: don't panic in table load
  • Loading branch information
alexwilcoxson-rel authored Jan 30, 2024
2 parents cc879e9 + 3cb1fca commit 7c98c49
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions crates/deltalake-core/src/kernel/snapshot/log_segment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -451,9 +451,13 @@ async fn list_log_files_with_checkpoint(
.collect_vec();

// TODO raise a proper error
assert_eq!(checkpoint_files.len(), cp.parts.unwrap_or(1) as usize);

Ok((commit_files, checkpoint_files))
if checkpoint_files.len() != cp.parts.unwrap_or(1) as usize {
Err(DeltaTableError::Generic(
format!("Checkpoint files inconsistent with checkpoint version {} metadata: expected {} files, found {:#?}", cp.version, cp.parts.unwrap_or(1), checkpoint_files)
))
} else {
Ok((commit_files, checkpoint_files))
}
}

/// List relevant log files.
Expand Down

0 comments on commit 7c98c49

Please sign in to comment.