rdblue commented on a change in pull request #3763:
URL: https://github.com/apache/iceberg/pull/3763#discussion_r772009800
##########
File path:
spark/v3.2/spark/src/main/java/org/apache/iceberg/spark/source/SparkScanBuilder.java
##########
@@ -157,8 +159,73 @@ private Schema schemaWithMetadataColumns() {
@Override
public Scan build() {
- return new SparkBatchQueryScan(
- spark, table, readConf, schemaWithMetadataColumns(),
filterExpressions);
+ Long snapshotId = readConf.snapshotId();
+ Long asOfTimestamp = readConf.asOfTimestamp();
+
+ Preconditions.checkArgument(snapshotId == null || asOfTimestamp == null,
+ "Cannot set both %s and %s to select which table snapshot to scan",
+ SparkReadOptions.SNAPSHOT_ID, SparkReadOptions.AS_OF_TIMESTAMP);
+
+ Long startSnapshotId = readConf.startSnapshotId();
+ Long endSnapshotId = readConf.endSnapshotId();
+
+ if (snapshotId != null || asOfTimestamp != null) {
+ Preconditions.checkArgument(startSnapshotId == null && endSnapshotId ==
null,
Review comment:
Can these checks be moved into `SparkReadConf` as a `validate` method?
--
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]