anoopj commented on code in PR #3235:
URL: https://github.com/apache/iceberg-rust/pull/3235#discussion_r4028853662
##########
crates/iceberg/src/io/object_cache.rs:
##########
@@ -444,6 +445,39 @@ mod tests {
);
}
+ #[tokio::test]
+ async fn test_get_manifest_list_with_no_schema_id() {
+ let mut fixture = TableTestFixture::new();
+ fixture.setup_manifest_files().await;
+
+ let current_snapshot =
fixture.table.metadata().current_snapshot().unwrap();
+
+ // The spec marks `schema-id` optional in every version (v1-v3), so a
+ // snapshot may omit it; fetching its manifest list must not depend on
the
+ // schema-id being present.
+ let snapshot: SnapshotRef = Snapshot::builder()
+ .with_snapshot_id(current_snapshot.snapshot_id())
+ .with_sequence_number(current_snapshot.sequence_number())
+ .with_timestamp_ms(current_snapshot.timestamp_ms())
+ .with_manifest_list(current_snapshot.manifest_list())
+ .with_summary(Summary {
+ operation: Operation::Append,
+ additional_properties: HashMap::new(),
+ })
+ .build()
+ .into();
+ assert!(snapshot.schema_id().is_none());
+
+ let object_cache = ObjectCache::new(fixture.table.file_io().clone(),
None);
+
+ let result_manifest_list = object_cache
+ .get_manifest_list(&snapshot, &fixture.table.metadata_ref())
+ .await
+ .unwrap();
+
+ assert_eq!(result_manifest_list.entries().len(), 1);
Review Comment:
That is a good idea. I added a second `get_manifest_list` call to excercise
this.
--
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]