rdblue commented on code in PR #6965:
URL: https://github.com/apache/iceberg/pull/6965#discussion_r1132991326
##########
spark/v3.3/spark/src/main/java/org/apache/iceberg/spark/source/SparkTable.java:
##########
@@ -248,21 +268,25 @@ public ScanBuilder
newScanBuilder(CaseInsensitiveStringMap options) {
icebergTable.refresh();
}
- CaseInsensitiveStringMap scanOptions = addSnapshotId(options, snapshotId);
- return new SparkScanBuilder(sparkSession(), icebergTable,
snapshotSchema(), scanOptions);
+ CaseInsensitiveStringMap scanOptions =
+ branch != null ? options : addSnapshotId(options, snapshotId);
+ return new SparkScanBuilder(
+ sparkSession(), icebergTable, branch, snapshotSchema(), scanOptions);
}
@Override
public WriteBuilder newWriteBuilder(LogicalWriteInfo info) {
Preconditions.checkArgument(
- snapshotId == null, "Cannot write to table at a specific snapshot:
%s", snapshotId);
+ branch != null || snapshotId == null,
Review Comment:
Would branch and snapshot ID ever be set at the same time? Those are
different constructors so I think we know they are mutually exclusive.
If so, then this can be the original check that `snapshotId` must be null.
--
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]