stevenzwu commented on code in PR #16688:
URL: https://github.com/apache/iceberg/pull/16688#discussion_r3389037110


##########
core/src/main/java/org/apache/iceberg/TrackedFile.java:
##########
@@ -49,6 +49,9 @@ interface TrackedFile {
   Types.NestedField FILE_SIZE_IN_BYTES =
       Types.NestedField.required(
           104, "file_size_in_bytes", Types.LongType.get(), "Total file size in 
bytes");
+  Types.NestedField WRITER_FORMAT_VERSION =
+      Types.NestedField.required(

Review Comment:
   I have concerns about the `WriterFormatVersion` enum approach.
   
   Existing precedent for table format version is plain int — `TableMetadata` 
uses `int formatVersion` with `MIN_FORMAT_VERSION_*` constants and direct 
compares (`formatVersion >= 3`).
   
   The enum hurts here:
   
   1. Likely call shape is `>= 4` checks (gate v4 metadata behavior); enum 
forces `.id() >= 4` at every site.
   2. `WriterFormatVersion.fromId` throws on unknown ids — a v4 reader will 
crash deserializing a v5-written leaf. Plain int + `>= 4` gate is 
forward-compatible.
   3. `PRE_V4` as a constant ages awkwardly when v5 ships.
   
   Suggest `int writerFormatVersion()` paralleling `int 
TableMetadata.formatVersion()`, with a named constant for any v4 boundary check.



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