ashvina commented on code in PR #791:
URL: https://github.com/apache/incubator-xtable/pull/791#discussion_r2767163196


##########
xtable-core/src/main/java/org/apache/xtable/delta/DeltaTableExtractor.java:
##########
@@ -44,6 +44,10 @@ public class DeltaTableExtractor {
 
   public InternalTable table(DeltaLog deltaLog, String tableName, Long 
version) {
     Snapshot snapshot = deltaLog.getSnapshotAt(version, Option.empty());
+    return table(snapshot, tableName);
+  }
+
+  public InternalTable table(Snapshot snapshot, String tableName) {

Review Comment:
   Consider adding a brief Javadoc on the new public api  `table(Snapshot, 
String)` explaining assumptions (`snapshot` must be valid and correspond to 
`tableName`’s table).
   
   Or, add a input validator 
   ```
   private static Snapshot requireMetadata(Snapshot s, String tableName) {
     if (s == null || s.metadata() == null || s.metadata().schema() == null) {
       throw new IllegalStateException("Missing metadata/schema for table: " + 
tableName 
         + " at version: " + (s != null ? s.version() : "unknown"));
     }
     return s;
   }
   ```



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

Reply via email to