You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "chenjunjiedada (via GitHub)" <gi...@apache.org> on 2023/05/10 09:49:09 UTC

[GitHub] [iceberg] chenjunjiedada commented on a diff in pull request #7362: Flink 1.17: Supports batch queries using time ranges

chenjunjiedada commented on code in PR #7362:
URL: https://github.com/apache/iceberg/pull/7362#discussion_r1189657172


##########
flink/v1.17/flink/src/main/java/org/apache/iceberg/flink/source/ScanContext.java:
##########
@@ -149,12 +152,26 @@ private void validate() {
     }
 
     Preconditions.checkArgument(
-        !(startTag != null && startSnapshotId() != null),
-        "START_SNAPSHOT_ID and START_TAG cannot both be set.");
+        atMostOneNonNull(startSnapshotId(), startTag, startSnapshotTimestamp()),
+        "Cannot specify more than one of start-snapshot-id, start-tag, or start-snapshot-timestamp.");
 
     Preconditions.checkArgument(
-        !(endTag != null && endSnapshotId() != null),
-        "END_SNAPSHOT_ID and END_TAG cannot both be set.");
+        atMostOneNonNull(endSnapshotId(), endTag, endSnapshotTimestamp()),
+        "Cannot specify more than one of end-snapshot-id, end-tag, or end-snapshot-timestamp.");

Review Comment:
   What if specify `start-snapshot-id` and `end-tag`? Do we need to check the options must be paired? 



-- 
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-unsubscribe@iceberg.apache.org

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


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