rdblue commented on code in PR #19129:
URL: https://github.com/apache/iceberg/pull/19129#discussion_r4807939317
##########
core/src/main/java/org/apache/iceberg/MergingSnapshotProducer.java:
##########
@@ -1093,41 +1021,21 @@ protected Map<String, String> summary() {
return summaryBuilder.build();
}
- // guard buffered deletes against concurrent format upgrade
- private void validateDeleteFilesForVersion(int currentFormatVersion) {
- for (DeleteFile file : v2Deletes) {
- validateDeleteFileForVersion(file, currentFormatVersion);
- }
- }
-
@Override
protected NewSnapshotMetadata writeRootManifest(
TableMetadata base, Snapshot parent, long sequenceNumber) {
- validateDeleteFilesForVersion(base.formatVersion());
-
- if (addsDeleteFiles()) {
- throw new UnsupportedOperationException("Cannot add new delete files in
v4");
- } else if (filterManager.containsDeletes()) {
- throw new UnsupportedOperationException("Cannot remove data files in
v4");
- } else if (deleteFilterManager.containsDeletes()) {
- throw new UnsupportedOperationException("Cannot remove delete files in
v4");
- } else if (!appendManifests.isEmpty()) {
- throw new UnsupportedOperationException("Cannot append manifest files in
v4");
- }
-
- if (rootManifestProducer == null || hasNewDataFiles) {
- this.rootManifestProducer = new RootManifestProducer(ops(),
snapshotId());
- for (DataFile file : Iterables.concat(newDataFilesBySpec.values())) {
- rootManifestProducer.appendFile(file);
- }
-
- this.hasNewDataFiles = false;
+ for (DeleteFile file : addedDeleteFiles) {
+ Preconditions.checkArgument(
+ ContentFileUtil.isDV(file),
+ "Must use DVs for deletes in v%s: %s",
+ formatVersion(),
+ file.location());
}
TrackedFile result = rootManifestProducer.apply(base, parent,
sequenceNumber);
Review Comment:
Moved the check here.
--
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]