Skip to content

Commit 7bf0884

Browse files
dentinysdd
andauthored
chore: minor update to manifest sanity check error message (#1278)
## What changes are included in this PR? This is the error message I get on my end: ```sh Error: DataInvalid => Content type of entry PositionDeletes should have DataContentType::Data ``` At first sight, I have no idea what this means, until I read the sanity check code. In this PR, I updated the error message for manifest write sanity check to provide more context: - What's the manifest content file - What's the filepath, this is useful for devs to directly understand what's the data file having issues - What's the expected and actual data content type ## Are these changes tested? No-op change Co-authored-by: Scott Donnelly <scott@donnel.ly>
1 parent a845327 commit 7bf0884

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

crates/iceberg/src/spec/manifest/writer.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,8 @@ impl ManifestWriter {
171171
return Err(Error::new(
172172
ErrorKind::DataInvalid,
173173
format!(
174-
"Content type of entry {:?} should have DataContentType::Data",
174+
"Date file at path {} with manifest content type `data`, should have DataContentType `Data`, but has `{:?}`",
175+
data_file.file_path(),
175176
data_file.content
176177
),
177178
));
@@ -183,7 +184,11 @@ impl ManifestWriter {
183184
{
184185
return Err(Error::new(
185186
ErrorKind::DataInvalid,
186-
format!("Content type of entry {:?} should have DataContentType::EqualityDeletes or DataContentType::PositionDeletes", data_file.content),
187+
format!(
188+
"Date file at path {} with manifest content type `deletes`, should have DataContentType `Data`, but has `{:?}`",
189+
data_file.file_path(),
190+
data_file.content
191+
),
187192
));
188193
}
189194
}

0 commit comments

Comments
 (0)