amogh-jahagirdar commented on code in PR #6074:
URL: https://github.com/apache/iceberg/pull/6074#discussion_r1016156921


##########
core/src/main/java/org/apache/iceberg/SnapshotManager.java:
##########
@@ -22,6 +22,7 @@
 
 public class SnapshotManager implements ManageSnapshots {
 
+  private final boolean isTransactionExternal;

Review Comment:
   Nit naming: could we call it "isExternalTransaction" or even just 
"externalTransaction"



##########
core/src/main/java/org/apache/iceberg/SnapshotManager.java:
##########
@@ -30,6 +31,17 @@ public class SnapshotManager implements ManageSnapshots {
         ops.current() != null, "Cannot manage snapshots: table %s does not 
exist", tableName);
     this.transaction =
         new BaseTransaction(tableName, ops, 
BaseTransaction.TransactionType.SIMPLE, ops.refresh());
+    this.isTransactionExternal = false;
+  }
+
+  SnapshotManager(BaseTransaction transaction) {
+    Preconditions.checkNotNull(transaction, "Input transaction cannot be 
null");
+    Preconditions.checkNotNull(
+        transaction.underlyingOps().current(),
+        "Cannot manage snapshots: table %s does not exist",
+        transaction.tableName());

Review Comment:
   Could we add tests for these 2 unhappy cases?



-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to