tomtongue commented on code in PR #16859:
URL: https://github.com/apache/iceberg/pull/16859#discussion_r4006146932


##########
core/src/main/java/org/apache/iceberg/MetadataLogEntriesTable.java:
##########
@@ -19,20 +19,43 @@
 package org.apache.iceberg;
 
 import java.util.List;
+import java.util.Map;
+import org.apache.iceberg.exceptions.NotFoundException;
 import org.apache.iceberg.io.CloseableIterable;
+import org.apache.iceberg.io.FileIO;
 import org.apache.iceberg.relocated.com.google.common.collect.Lists;
 import org.apache.iceberg.types.Types;
 import org.apache.iceberg.util.SnapshotUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
+/**
+ * A {@link Table} implementation that exposes a table's metadata log as rows.
+ *
+ * <p>Each row represents a historical or current metadata file and includes 
the snapshot details
+ * and table properties recorded in that file. The current metadata is 
included as the latest row.
+ *
+ * <p>Queries that reference {@code properties} read each retained historical 
metadata file. These
+ * additional reads are skipped when {@code properties} is not referenced, and 
the already loaded
+ * current metadata is reused.
+ */
 public class MetadataLogEntriesTable extends BaseMetadataTable {
 
+  private static final int PROPERTIES_FIELD_ID = 6;

Review Comment:
   @laskoviymishka  I revisited adding this check and I would like to revise my 
previous response.
   
   The `properties` field is declared with `PROPERTIES_FIELD_ID`. And ,the 
projection check determining whether to load `properties` uses that same 
constant:
   
   ```java
   // L93 in the current commit
       boolean skipPropertiesLoad = 
projectedSchema.findField(PROPERTIES_FIELD_ID) == null;
   ```
   
   Field IDs are explicitly assigned, and `findField(int)` looks up a field by 
ID. Inserting or reordering fields therefore does not change which field the 
constant identifies.
   
   The assertion could catch a future edit that changes the declaration 
independently. But I don't think that additional runtime check is needed with 
the shared constant here. I plan to remove the static block and its unused 
`Preconditions` import, and keep the `LOG` placement change.
   
   If you see any issues with this approach, please let me know, and I’ll 
update the implementation accordingly.



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