rdblue commented on a change in pull request #2925:
URL: https://github.com/apache/iceberg/pull/2925#discussion_r698068407
##########
File path: core/src/main/java/org/apache/iceberg/BaseReplacePartitions.java
##########
@@ -53,6 +61,45 @@ public ReplacePartitions validateAppendOnly() {
return this;
}
+ @Override
+ public ReplacePartitions validateFromSnapshot(long snapshotId) {
+ this.startingSnapshotId = snapshotId;
+ return this;
+ }
+
+ @Override
+ public ReplacePartitions validateNoConflictingAppends() {
+ this.validateNoConflictingAppends = true;
+ return this;
+ }
+
+ @Override
+ public void validate(TableMetadata currentMetadata) {
+ if (validateNoConflictingAppends) {
+ Expression conflictDetectionFilter;
+ if (writeSpec().isUnpartitioned()) {
+ // Unpartitioned table, check against all files
+ conflictDetectionFilter = Expressions.alwaysTrue();
+ } else {
+ conflictDetectionFilter = deletedPartitions.stream().map(p -> {
Review comment:
I don't think it's necessary to convert the partition set to a filter.
You should be able to just omit the filter when configuring the `ManifestGroup`
and apply it by calling `contains(file.specId, file.partition)` for each data
file returned by the group.
--
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]