nastra commented on code in PR #14561:
URL: https://github.com/apache/iceberg/pull/14561#discussion_r2514969055
##########
core/src/main/java/org/apache/iceberg/rest/requests/PlanTableScanRequest.java:
##########
@@ -88,9 +88,17 @@ private PlanTableScanRequest(
@Override
public void validate() {
- Preconditions.checkArgument(
- snapshotId != null ^ (startSnapshotId != null && endSnapshotId !=
null),
- "Either snapshotId must be provided or both startSnapshotId and
endSnapshotId must be provided");
+ if (null != snapshotId) {
+ Preconditions.checkArgument(
+ null == startSnapshotId && null == endSnapshotId,
+ "Invalid scan: cannot provide both snapshotId and
startSnapshotId/endSnapshotId");
+ }
+
+ if (null != startSnapshotId || null != endSnapshotId) {
+ Preconditions.checkArgument(
+ null != startSnapshotId && null != endSnapshotId,
+ "Invalid incremental scan: startSnapshotId and endSnapshotId is
required");
+ }
Review Comment:
so this case is less about the client being aware of the latest snapshot and
more about aligning the impl with the spec, since the spec clearly defines the
wording for it.
--
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]