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.file- A data file to append
appendManifest()
Appends a manifest file to the table.file- A manifest file containing only appended files
- 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
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
FromSnapshotUpdate:
commit()- Commits the changes and creates a new snapshotset(String key, String value)- Sets a summary propertydeleteWith(Consumer<String> deleteFunc)- Sets a delete callback
See Also
- OverwriteFiles - Overwrite files in a table
- DeleteFiles - Delete files from a table
- RowDelta - Row-level changes
- DataFile - Data file representation