szehon-ho commented on a change in pull request #2925:
URL: https://github.com/apache/iceberg/pull/2925#discussion_r714232868
##########
File path: spark3/src/main/java/org/apache/iceberg/spark/source/SparkWrite.java
##########
@@ -260,16 +265,29 @@ public void commit(WriterCommitMessage[] messages) {
}
private class DynamicOverwrite extends BaseBatchWrite {
+
+ private final IsolationLevel isolationLevel;
+ private final long startingSnapshotId;
+
+ private DynamicOverwrite(IsolationLevel isolationLevel, long
startingSnapshotId) {
+ this.isolationLevel = isolationLevel;
+ this.startingSnapshotId = startingSnapshotId;
+ }
+
@Override
public void commit(WriterCommitMessage[] messages) {
ReplacePartitions dynamicOverwrite = table.newReplacePartitions();
+ dynamicOverwrite.validateFromSnapshot(startingSnapshotId);
int numFiles = 0;
for (DataFile file : files(messages)) {
numFiles += 1;
dynamicOverwrite.addFile(file);
}
+ if (isolationLevel == SERIALIZABLE) {
+ dynamicOverwrite.validateNoConflictingAppends();
+ }
Review comment:
Sure, done.
--
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]