gaborkaszab commented on code in PR #6074:
URL: https://github.com/apache/iceberg/pull/6074#discussion_r1050562294
##########
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.isExternalTransaction = false;
+ }
+
+ SnapshotManager(BaseTransaction transaction) {
+ Preconditions.checkNotNull(transaction, "Input transaction cannot be
null");
+ Preconditions.checkNotNull(
Review Comment:
Ohh, I totally misunderstood your comment then, and writing such a long
answer wasn't necessary at all :)
This precondition is let's say partially intentional as I wanted to follow
the existing constructor that has a [similar
check](https://github.com/apache/iceberg/blob/c07f2aabc0a1d02f068ecf1514d2479c0fbdd3b0/core/src/main/java/org/apache/iceberg/SnapshotManager.java#L29).
After giving this a thought this check might make sense as everything in
SnapshotManager requires snapshot IDs or branch names that we won't have with a
createTransaction().
--
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]