Skip to main content
The AppendFiles interface provides an API for appending new data files to an Iceberg table.

Overview

AppendFiles accumulates file additions, produces a new snapshot of the table, and commits that snapshot as the current. This is the primary interface for adding new data to a table.

Interface

Core Methods

appendFile()

Appends a data file to the table.
Parameters:
  • file - A data file to append
Returns: This for method chaining Example:

appendManifest()

Appends a manifest file to the table.
Parameters:
  • file - A manifest file containing only appended files
Returns: This for method chaining Description: The manifest must contain only appended files. All files in the manifest will be appended to the table in the snapshot created by this update. The manifest will be used directly if snapshot ID inheritance is enabled (format version > 1 or explicitly enabled). Otherwise, it will be rewritten to assign all entries this update’s snapshot ID. Lifecycle Management:
  • If the manifest is rewritten, the caller must manage the lifecycle of the original manifest
  • If the manifest is used directly and the commit succeeds, it becomes part of table metadata
  • If the manifest gets merged with others, it will be deleted automatically on success
  • If the commit fails, the manifest is never deleted
Example:

Examples

Basic Append Operation

Appending Multiple Files

Append with Metrics

Partitioned Append

Append with Snapshot Properties

Appending Manifest Files

Atomic Multi-File Append

Append with Validation

Incremental Append Pattern

Commit Behavior

When committing, changes are applied to the latest table snapshot:
  • Conflict Resolution: Commit conflicts are resolved by applying changes to the new latest snapshot and reattempting the commit
  • Atomicity: All files are added atomically - either all succeed or none are added
  • Snapshot Creation: A new snapshot is created containing all existing data plus the appended files

Inherited Methods

From SnapshotUpdate:
  • commit() - Commits the changes and creates a new snapshot
  • set(String key, String value) - Sets a summary property
  • deleteWith(Consumer<String> deleteFunc) - Sets a delete callback

See Also