liurenjie1024 commented on code in PR #29:
URL: https://github.com/apache/iceberg-rust/pull/29#discussion_r1293186620
##########
crates/iceberg/src/spec/snapshot.rs:
##########
@@ -208,8 +222,11 @@ impl From<SnapshotV1> for Snapshot {
parent_snapshot_id: v1.parent_snapshot_id,
sequence_number: 0,
timestamp_ms: v1.timestamp_ms,
- manifest_list: v1.manifest_list.unwrap_or_default(),
- manifests: v1.manifests,
+ manifest_list: match (v1.manifest_list, v1.manifests) {
+ (Some(file), _) => ManifestList::ManifestListFile(file),
+ (None, Some(files)) => ManifestList::ManifestFiles(files),
+ (None, None) => panic!("Neither manifestlist file or manifest
files are provided."),
Review Comment:
I think we should return error here since this wrong format doesn't have to
be a bug, rather invalid data.
##########
crates/iceberg/src/spec/table_metadata.rs:
##########
@@ -514,20 +501,20 @@ impl TryFrom<TableMetadataV1> for TableMetadata {
partition_specs,
schemas,
- properties: value.properties,
+ properties: value.properties.unwrap_or_default(),
Review Comment:
This comment is related to next line of `current_snapshot_id`. It seems -1
means empty `current_snapsht_id`, so we should check it when assigning.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]