rdblue commented on code in PR #16867:
URL: https://github.com/apache/iceberg/pull/16867#discussion_r3456139767
##########
core/src/main/java/org/apache/iceberg/TrackedFileAdapters.java:
##########
@@ -405,6 +418,135 @@ public DeleteFile copyWithStats(Set<Integer>
requestedColumnIds) {
}
}
+ /**
+ * Adapts a TrackedFile DATA_MANIFEST or DELETE_MANIFEST entry to the {@link
ManifestFile}
+ * interface.
+ */
+ private static class TrackedManifestFile implements ManifestFile {
+ private final TrackedFile file;
+
+ private TrackedManifestFile(TrackedFile file) {
+ Preconditions.checkArgument(
+ file.tracking().dataSequenceNumber() != null,
+ "Cannot create manifest file: no data sequence number");
+ Preconditions.checkArgument(
+ file.tracking().snapshotId() != null, "Cannot create manifest file:
no snapshot ID");
+ Preconditions.checkArgument(
+ file.manifestInfo() != null, "Cannot create manifest file: no
manifest info");
+ Preconditions.checkArgument(
+ file.manifestInfo().dv() == null,
+ "Cannot adapt manifest with a deletion vector to ManifestFile: %s",
+ file.location());
+ this.file = file;
+ }
+
+ @Override
+ public String path() {
+ return file.location();
+ }
+
+ @Override
+ public long length() {
+ return file.fileSizeInBytes();
+ }
+
+ @Override
+ public int partitionSpecId() {
+ throw new UnsupportedOperationException(
+ "Tracked manifests are not bound to a single partition spec");
Review Comment:
I don't think that it is correct to say "Tracked manifests": what is a
"tracked" manifest and why is one from a manifest list not "tracked"?
I think it is better to say "v4 manifests are not bound to a single
partition spec".
--
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]