rdblue commented on code in PR #17932:
URL: https://github.com/apache/iceberg/pull/17932#discussion_r3929038882


##########
core/src/test/java/org/apache/iceberg/TestTrackedFileAdapters.java:
##########
@@ -346,6 +368,108 @@ void dvDeleteFileAdapterRejectsNullDeletionVector() {
         .hasMessage("Cannot create DV delete file: no deletion vector");
   }
 
+  @ParameterizedTest
+  @EnumSource(
+      value = FileContent.class,
+      names = {"DATA_MANIFEST", "DELETE_MANIFEST"})
+  void manifestFileAdapterDelegation(FileContent contentType) {
+    TrackedFile file =
+        new TrackedFileStruct(
+            MANIFEST_TRACKING,
+            contentType,
+            FORMAT_VERSION_V4,
+            MANIFEST_LOCATION,
+            FileFormat.PARQUET,
+            0L,
+            MANIFEST_FILE_SIZE,
+            null,
+            null,
+            null,
+            null,
+            null,
+            MANIFEST_INFO,
+            MANIFEST_KEY_METADATA,
+            null,
+            null);
+
+    ManifestFile manifest = TrackedFileAdapters.asManifestFile(file);
+
+    ManifestContent expectedContent =
+        contentType == FileContent.DATA_MANIFEST ? ManifestContent.DATA : 
ManifestContent.DELETES;
+    assertThat(manifest.path()).isEqualTo(MANIFEST_LOCATION);
+    assertThat(manifest.length()).isEqualTo(MANIFEST_FILE_SIZE);
+    assertThat(manifest.content()).isEqualTo(expectedContent);
+    assertThat(manifest.sequenceNumber()).isEqualTo(DATA_SEQUENCE_NUMBER);
+    
assertThat(manifest.minSequenceNumber()).isEqualTo(MANIFEST_INFO.minSequenceNumber());
+    assertThat(manifest.snapshotId()).isEqualTo(SNAPSHOT_ID);
+    
assertThat(manifest.addedFilesCount()).isEqualTo(MANIFEST_INFO.addedFilesCount());
+    
assertThat(manifest.addedRowsCount()).isEqualTo(MANIFEST_INFO.addedRowsCount());
+    
assertThat(manifest.existingFilesCount()).isEqualTo(MANIFEST_INFO.existingFilesCount());
+    
assertThat(manifest.existingRowsCount()).isEqualTo(MANIFEST_INFO.existingRowsCount());
+    
assertThat(manifest.deletedFilesCount()).isEqualTo(MANIFEST_INFO.deletedFilesCount());
+    
assertThat(manifest.deletedRowsCount()).isEqualTo(MANIFEST_INFO.deletedRowsCount());
+    assertThat(manifest.firstRowId()).isEqualTo(FIRST_ROW_ID);
+    assertThat(manifest.keyMetadata()).isEqualTo(MANIFEST_KEY_METADATA);
+    
assertThat(manifest.deletionVector()).isEqualTo(ByteBuffer.wrap(MANIFEST_DV));
+    assertThat(manifest.partitions()).isNull();
+  }
+
+  @Test
+  void manifestFileAdapterPartitionSpecIdUnsupported() {
+    TrackedFile file =

Review Comment:
   This test case could be combined with the previous case. That would avoid 
creating a nearly identical tracked file that leaves the reader wondering what 
changed between the two cases.



-- 
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]

Reply via email to