Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: remove support of manifest list format as a list of file path (#158) #200

Conversation

Dysprosium0626
Copy link
Contributor

This PR aims for issue #158. Since we don't plan to support the manifest list as manifest list file, we will remove support for it. I remove all ManifestListLocation::ManifestFiles and and replace all ManifestListLocation::ManifestListFile with String

@Dysprosium0626 Dysprosium0626 force-pushed the remove-support-of-manifest-list-format-as-a-list-of-file-paths branch 3 times, most recently from 14c3ae2 to acb4422 Compare February 17, 2024 06:17
Copy link
Collaborator

@liurenjie1024 liurenjie1024 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Dysprosium0626 Thanks for this pr, it looks great! I've left some small comments to improve.

crates/iceberg/src/spec/snapshot.rs Outdated Show resolved Hide resolved
crates/iceberg/src/spec/snapshot.rs Outdated Show resolved Hide resolved
crates/iceberg/src/spec/snapshot.rs Outdated Show resolved Hide resolved
(Some(file), _) => ManifestListLocation::ManifestListFile(file),
(None, Some(files)) => ManifestListLocation::ManifestFiles(files),
(None, None) => {
manifest_list: match v1.manifest_list {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should change this to report error better:

match (v1.manifest_list, v1.manifests) {
 (Some(file), None) => file,
 (Some(file), Some(_)) => "Invalid v1 snapshot, when manifest list provided, manifest files should be omitted",
 (None, _) => "Unsupported v1 snapshot, only manifest list is supported"
}

@@ -262,8 +243,6 @@ pub(super) mod _serde {
#[serde(skip_serializing_if = "Option::is_none")]
pub manifest_list: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub manifests: Option<Vec<String>>,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should still keep this field for better error reporting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants