rdblue commented on code in PR #17932:
URL: https://github.com/apache/iceberg/pull/17932#discussion_r3938138303
##########
core/src/main/java/org/apache/iceberg/TrackedFileAdapters.java:
##########
@@ -415,6 +424,114 @@ public DeleteFile copyWithStats(Set<Integer>
requestedColumnIds) {
}
}
+ /** Adapts a TrackedFile to {@link ManifestFile}. */
+ private static class TrackedManifestFile implements ManifestFile {
+ private final TrackedFile file;
+
+ private TrackedManifestFile(TrackedFile file) {
+ this.file = file;
+ }
+
+ @Override
+ public String path() {
+ return file.location();
+ }
+
+ @Override
+ public long length() {
+ return file.fileSizeInBytes();
+ }
+
+ @Override
+ public int partitionSpecId() {
+ throw new UnsupportedOperationException(
+ "v4 manifests are not bound to a single partition spec");
+ }
+
+ @Override
+ public ManifestContent content() {
+ switch (file.contentType()) {
+ case DATA_MANIFEST:
+ return ManifestContent.DATA;
+ case DELETE_MANIFEST:
+ return ManifestContent.DELETES;
+ default:
+ throw new UnsupportedOperationException(
+ "Unsupported content type for manifests: " + file.contentType());
+ }
+ }
+
+ @Override
+ public long sequenceNumber() {
+ return file.tracking().dataSequenceNumber();
+ }
+
+ @Override
+ public long minSequenceNumber() {
+ return file.manifestInfo().minSequenceNumber();
+ }
+
+ @Override
+ public Long snapshotId() {
+ return file.tracking().snapshotId();
+ }
+
+ @Override
+ public Integer addedFilesCount() {
+ return file.manifestInfo().addedFilesCount();
+ }
+
+ @Override
+ public Long addedRowsCount() {
+ return file.manifestInfo().addedRowsCount();
+ }
+
+ @Override
+ public Integer existingFilesCount() {
+ return file.manifestInfo().existingFilesCount();
+ }
+
+ @Override
+ public Long existingRowsCount() {
+ return file.manifestInfo().existingRowsCount();
+ }
+
+ @Override
+ public Integer deletedFilesCount() {
+ return file.manifestInfo().deletedFilesCount();
+ }
+
+ @Override
+ public Long deletedRowsCount() {
+ return file.manifestInfo().deletedRowsCount();
+ }
+
+ @Override
+ public List<PartitionFieldSummary> partitions() {
+ return null;
+ }
+
+ @Override
+ public ByteBuffer keyMetadata() {
+ return file.keyMetadata();
+ }
+
+ @Override
+ public Long firstRowId() {
+ return file.tracking().firstRowId();
+ }
+
+ @Override
+ public ByteBuffer manifestDeletionVector() {
+ return file.manifestInfo().dv();
Review Comment:
For now, I think we should replace this with a placeholder implementation or
null:
```java
return new EmbeddedBitmap() {
@Override
public int cardinality() {
throw new UnsupportedOperationException("Bitmap decoding has not
been implemented");
}
@Override
public boolean isSet(int position) {
throw new UnsupportedOperationException("Bitmap decoding has not
been implemented");
}
@Override
public ByteBuffer buffer() {
return file.manifestInfo().dv();
}
};
```
I'd be fine returning `null` for now. Either way, once this is in we will
need to get the bitmap implementation in and update the `V4ManfiestReader` to
use it.
--
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]