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


##########
core/src/test/java/org/apache/iceberg/TestTrackedFileAdapters.java:
##########
@@ -75,40 +71,34 @@ class TestTrackedFileAdapters {
   // TrackedFile optional field ordinals, looked up from the schema.
   private static final Types.StructType TRACKED_FILE_SCHEMA =
       TrackedFile.schemaWithContentStats(Types.StructType.of(), 
Types.StructType.of());
+  private static final int CONTENT_TYPE_ORDINAL = 
ordinalOf(TRACKED_FILE_SCHEMA, "content_type");
   private static final int SPEC_ID_ORDINAL = ordinalOf(TRACKED_FILE_SCHEMA, 
"spec_id");
-  private static final int CONTENT_STATS_ORDINAL = 
ordinalOf(TRACKED_FILE_SCHEMA, "content_stats");
-  private static final int SORT_ORDER_ID_ORDINAL = 
ordinalOf(TRACKED_FILE_SCHEMA, "sort_order_id");
   private static final int DELETION_VECTOR_ORDINAL =
       ordinalOf(TRACKED_FILE_SCHEMA, "deletion_vector");
-  private static final int KEY_METADATA_ORDINAL = 
ordinalOf(TRACKED_FILE_SCHEMA, "key_metadata");
-  private static final int SPLIT_OFFSETS_ORDINAL = 
ordinalOf(TRACKED_FILE_SCHEMA, "split_offsets");
-  private static final int EQUALITY_IDS_ORDINAL = 
ordinalOf(TRACKED_FILE_SCHEMA, "equality_ids");
 
   @Test
   void testDataFileAdapterDelegation() {
-    PartitionData partition = partition("books");
-
-    TrackedFileStruct file =
-        new TrackedFileStruct(
-            createTracking(),
-            FileContent.DATA,
-            WRITER_FORMAT_VERSION,
-            DATA_FILE_LOCATION,
-            FileFormat.PARQUET,
-            partition,
-            100L,
-            1024L);
-    file.set(SPEC_ID_ORDINAL, PARTITIONED_SPEC_ID);
-    file.set(CONTENT_STATS_ORDINAL, createContentStats());
-    file.set(SORT_ORDER_ID_ORDINAL, 3);
-    file.set(KEY_METADATA_ORDINAL, ByteBuffer.wrap(new byte[] {1, 2, 3}));
-    file.set(SPLIT_OFFSETS_ORDINAL, ImmutableList.of(50L, 100L));
+    TrackedFile file =

Review Comment:
   What is the use of going through the builder for tests? I think that this 
should simply use the constructor and pass all values. There's an argument for 
using this to make the test cases more clear (this is certainly readable) but 
it also doesn't allow us to construct some instances that we may want to test 
because they violate rules that the builder enforces.



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