gaborkaszab commented on code in PR #16769:
URL: https://github.com/apache/iceberg/pull/16769#discussion_r3427966408


##########
core/src/test/java/org/apache/iceberg/TestTrackedFileAdapters.java:
##########
@@ -146,41 +138,36 @@ void testDataFileAdapterRejectsNonDataContent(FileContent 
contentType) {
 
   @Test
   void testEqualityDeleteFileAdapterDelegation() {
-    PartitionData partition = partition("books");
-
     TrackedFileStruct file =
-        new TrackedFileStruct(
-            createTracking(),
-            FileContent.EQUALITY_DELETES,
-            "s3://bucket/eq-delete.avro",
-            FileFormat.AVRO,
-            partition,
-            50L,
-            512L);
-    file.set(SPEC_ID_ORDINAL, PARTITIONED_SPEC_ID);
-    file.set(CONTENT_STATS_ORDINAL, createContentStats());
-    file.set(SORT_ORDER_ID_ORDINAL, 5);
-    file.set(KEY_METADATA_ORDINAL, ByteBuffer.wrap(new byte[] {4, 5}));
-    file.set(SPLIT_OFFSETS_ORDINAL, ImmutableList.of(200L));
-    file.set(EQUALITY_IDS_ORDINAL, ImmutableList.of(1, 2, 3));
+        (TrackedFileStruct)
+            TrackedFileBuilder.equalityDelete(42L)
+                .location("s3://bucket/eq-delete.avro")
+                .fileFormat(FileFormat.AVRO)
+                .partition(PARTITION)
+                .recordCount(50L)
+                .fileSizeInBytes(512L)
+                .specId(PARTITIONED_SPEC_ID)
+                .contentStats(createContentStats())
+                .keyMetadata(ByteBuffer.wrap(new byte[] {4, 5}))
+                .equalityIds(ImmutableList.of(1, 2, 3))
+                .build();
+    populateDerivedAndInheritedFields(file);
 
     DeleteFile deleteFile =
         TrackedFileAdapters.asEqualityDeleteFile(file, 
specsById(PARTITIONED_SPEC));
 
     assertThat(deleteFile.pos()).isEqualTo(MANIFEST_POS);
     assertThat(deleteFile.specId()).isEqualTo(PARTITIONED_SPEC_ID);
-    assertThat(deleteFile.partition()).isSameAs(partition);
+    assertThat(deleteFile.partition()).isSameAs(PARTITION);
     assertThat(deleteFile.content()).isEqualTo(FileContent.EQUALITY_DELETES);
     assertThat(deleteFile.location()).isEqualTo("s3://bucket/eq-delete.avro");
     assertThat(deleteFile.format()).isEqualTo(FileFormat.AVRO);
     assertThat(deleteFile.recordCount()).isEqualTo(50L);
     assertThat(deleteFile.fileSizeInBytes()).isEqualTo(512L);
-    assertThat(deleteFile.sortOrderId()).isEqualTo(5);

Review Comment:
   EQ-deletes don't allow sort order and splitOffset through the builder. 
Removed the checks before no longer makes sense.



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