rdblue commented on a change in pull request #1115:
URL: https://github.com/apache/iceberg/pull/1115#discussion_r441030228



##########
File path: core/src/main/java/org/apache/iceberg/BaseTableScan.java
##########
@@ -135,19 +123,18 @@ public TableScan appendsAfter(long fromSnapshotId) {
 
   @Override
   public TableScan useSnapshot(long scanSnapshotId) {
-    Preconditions.checkArgument(this.snapshotId == null,
-        "Cannot override snapshot, already set to id=%s", snapshotId);
+    Preconditions.checkState(context.snapshotId() == null,

Review comment:
       I think this should continue to be an `IllegalArgumentException` because 
it is validating the argument passed into `useSnapshot`. The problem is not 
with the context, it is with how the user is trying to modify that context.




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

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