Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions core/src/main/java/org/apache/iceberg/GenericManifestEntry.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,21 @@

class GenericManifestEntry implements ManifestEntry, IndexedRecord, SpecificData.SchemaConstructable, StructLike {
private final org.apache.avro.Schema schema;
private final V1Metadata.IndexedDataFile fileWrapper;
private Status status = Status.EXISTING;
private Long snapshotId = null;
private Long sequenceNumber = null;
private DataFile file = null;

GenericManifestEntry(org.apache.avro.Schema schema) {
this.schema = schema;
this.fileWrapper = null; // do not use the file wrapper to read
}

GenericManifestEntry(Types.StructType partitionType) {
this.schema = AvroSchemaUtil.convert(V1Metadata.entrySchema(partitionType), "manifest_entry");
this.fileWrapper = new V1Metadata.IndexedDataFile(schema.getField("data_file").schema());
}

private GenericManifestEntry(GenericManifestEntry toCopy, boolean fullCopy) {
this.schema = toCopy.schema;
this.fileWrapper = new V1Metadata.IndexedDataFile(schema.getField("data_file").schema());
this.status = toCopy.status;
this.snapshotId = toCopy.snapshotId;
if (fullCopy) {
Expand Down Expand Up @@ -163,11 +159,7 @@ public Object get(int i) {
case 2:
return sequenceNumber;
case 3:
if (fileWrapper == null || file instanceof GenericDataFile) {
return file;
} else {
return fileWrapper.wrap(file);
}
return file;
default:
throw new UnsupportedOperationException("Unknown field ordinal: " + i);
}
Expand Down