kbendick commented on a change in pull request #4329:
URL: https://github.com/apache/iceberg/pull/4329#discussion_r831623986



##########
File path: 
flink/v1.14/flink/src/main/java/org/apache/iceberg/flink/source/ScanContext.java
##########
@@ -114,77 +128,100 @@ private ScanContext(boolean caseSensitive, Long 
snapshotId, Long startSnapshotId
     this.includeColumnStats = includeColumnStats;
     this.exposeLocality = exposeLocality;
     this.planParallelism = planParallelism;
+
+    validate();
+  }
+
+  private void validate() {
+    if (isStreaming) {
+      if (startingStrategy == 
StreamingStartingStrategy.SPECIFIC_START_SNAPSHOT_ID) {
+        Preconditions.checkArgument(startSnapshotId != null,
+            "startSnapshotId cannot be null for SPECIFIC_START_SNAPSHOT_ID 
starting strategy");
+      }
+      if (startingStrategy == 
StreamingStartingStrategy.SPECIFIC_START_SNAPSHOT_TIMESTAMP) {
+        Preconditions.checkArgument(startSnapshotTimestamp != null,
+            "startSnapshotTimestamp cannot be null for 
SPECIFIC_START_SNAPSHOT_TIMESTAMP starting strategy");

Review comment:
       Should we validate that  `startSnapshotId` isn't supplied if the user 
has set the `startingStrategy` to be by timestamp.
   
   As well as making sure there's not a provided `startSnapshotTimestamp`  when 
using snapshot id starting strategy?




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

Reply via email to