singhpk234 commented on code in PR #4809:
URL: https://github.com/apache/iceberg/pull/4809#discussion_r876957920


##########
core/src/main/java/org/apache/iceberg/util/SnapshotUtil.java:
##########
@@ -307,7 +307,10 @@ public static Schema schemaFor(Table table, long 
snapshotId) {
       return schema;
     }
 
-    // TODO: recover the schema by reading previous metadata files
+    snapshot = table.snapshot(snapshot.parentId());

Review Comment:
   [minor] should we rename this`parentSnapshot` ?



##########
core/src/main/java/org/apache/iceberg/util/SnapshotUtil.java:
##########
@@ -307,7 +307,10 @@ public static Schema schemaFor(Table table, long 
snapshotId) {
       return schema;
     }
 
-    // TODO: recover the schema by reading previous metadata files
+    snapshot = table.snapshot(snapshot.parentId());
+    if (snapshot != null) {
+      return table.schemas().get(snapshot.schemaId());

Review Comment:
   [question] can it be possible that even parentSnapshot is also lacking 
schemaId ? 
   
   If this is true we can now return `null` earlier we were returning 
`table.schema()` instead. WDYT ?



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