Skip to content
Draft
Show file tree
Hide file tree
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
39 changes: 39 additions & 0 deletions api/src/main/java/org/apache/iceberg/ManifestFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@
public interface ManifestFile {
int PARTITION_SUMMARIES_ELEMENT_ID = 508;

/** Value of {@link #formatVersion()} for v4 manifest files. */
int V4_FORMAT_VERSION = 4;

/** Value of {@link #formatVersion()} for pre-v4 manifest files (v1, v2, and v3). */
int LEGACY_FORMAT_VERSION = 0;

Types.NestedField PATH =
required(500, "manifest_path", Types.StringType.get(), "Location URI with FS scheme");
Types.NestedField LENGTH =
Expand Down Expand Up @@ -186,6 +192,26 @@ default boolean hasDeletedFiles() {
/** Returns the total number of rows in all files with status DELETED in the manifest file. */
Long deletedRowsCount();

/**
* Returns the number of files with status REPLACED in the manifest file, or null if not tracked.
*
* <p>REPLACED files are the prior-state entries of v4 REPLACED/MODIFIED pairs and are not live.
* Returns null for manifest files written by pre-v4 writers.
*/
default Integer replacedFilesCount() {
return null;
}

/**
* Returns the total number of rows in all files with status REPLACED in the manifest file, or
* null if not tracked.
*
* <p>Returns null for manifest files written by pre-v4 writers.
*/
default Long replacedRowsCount() {
return null;
}

/**
* Returns a list of {@link PartitionFieldSummary partition field summaries}.
*
Expand All @@ -210,6 +236,19 @@ default Long firstRowId() {
return null;
}

/** Returns the number of records in the manifest file, or {@code null} for pre-v4 manifests. */
default Long recordCount() {
return null;
}

/**
* Returns the format version of the manifest file, or {@link #LEGACY_FORMAT_VERSION} for pre-v4
* manifests.
*/
default int formatVersion() {
return LEGACY_FORMAT_VERSION;
}

/**
* Copies this {@link ManifestFile manifest file}. Readers can reuse manifest file instances; use
* this method to make defensive copies.
Expand Down
Loading