anoopj commented on code in PR #19007:
URL: https://github.com/apache/iceberg/pull/19007#discussion_r4760018357
##########
core/src/main/java/org/apache/iceberg/V4ManifestWriter.java:
##########
@@ -170,30 +184,59 @@ public void appendAtSeq(TrackedFile file, long
dataSequenceNumber) {
}
public void modify(TrackedFile file, DeletionVector dv) {
+ Preconditions.checkArgument(
+ file.contentType() == FileContent.DATA,
+ "Cannot modify %s file with a data DV: %s",
+ file.contentType(),
+ file.location());
+
TrackingBuilder modified = TrackingBuilder.from(file.tracking(),
snapshotId).dvUpdated();
- TrackedFile withNewDV = Delegates.withDV(file, dv);
+ TrackedFile withNewDV = Delegates.withDataDV(file, dv);
write(withNewDV, modified.build());
}
public void existing(TrackedFile file) {
+ Preconditions.checkArgument(
+ file.contentType() == FileContent.DATA
+ || file.contentType() == FileContent.DATA_MANIFEST
+ || file.contentType() == FileContent.DELETE_MANIFEST,
+ "Cannot add existing %s file: %s",
+ file.contentType(),
+ file.location());
+
Tracking existing = TrackingBuilder.from(file.tracking(),
snapshotId).build();
write(file, existing);
}
public void replace(TrackedFile file) {
+ Preconditions.checkArgument(
+ file.contentType() == FileContent.DATA || file.contentType() ==
FileContent.DATA_MANIFEST,
+ "Cannot replace %s file: %s",
+ file.contentType(),
+ file.location());
+
Review Comment:
Is column files on leaf manifests an example where we might need `REPLACED`
status? If true, maybe the test case could make it clearer.
--
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]