Overview
Currently, Iceberg supports the Snapshot Table action for migrating from Delta Lake to Iceberg tables.Since Delta Lake tables maintain transactions, all available transactions will be committed to the new Iceberg table as transactions in order.
The Add Transaction action, a variant of the Add File action, is still under development.
Enabling Migration from Delta Lake to Iceberg
Theiceberg-delta-lake module is not bundled with Spark and Flink engine runtimes. To enable migration from Delta Lake features, the minimum required dependencies are:
Compatibilities
The module is built and tested with Delta Standalone 0.6.0 and supports Delta Lake tables with the following protocol version:minReaderVersion: 1minWriterVersion: 2
API
Theiceberg-delta-lake module provides an interface named DeltaLakeToIcebergMigrationActionsProvider, which contains actions that help convert from Delta Lake to Iceberg.
The supported actions are:
snapshotDeltaLakeTable: Snapshot an existing Delta Lake table to an Iceberg table
Default Implementation
Theiceberg-delta-lake module also provides a default implementation of the interface which can be accessed by:
Snapshot Delta Lake Table to Iceberg
The actionsnapshotDeltaLakeTable reads the Delta Lake table’s transactions and converts them to a new Iceberg table with the same schema and partitioning in one Iceberg transaction. The original Delta Lake table remains unchanged.
The newly created table can be changed or written to without affecting the source table, but the snapshot uses the original table’s data files. Existing data files are added to the Iceberg table’s metadata and can be read using a name-to-id mapping created from the original table schema.
When inserts or overwrites run on the snapshot, new files are placed in the snapshot table’s location. The location defaults to be the same as that of the source Delta Lake Table. Users can also specify a different location for the snapshot table.
Usage
| Required Input | Configured By | Description |
|---|---|---|
| Source Table Location | Argument sourceTableLocation | The location of the source Delta Lake table |
| New Iceberg Table Identifier | Configuration API as | The identifier specifies the namespace and table name for the new Iceberg table |
| Iceberg Catalog | Configuration API icebergCatalog | The catalog used to create the new Iceberg table |
| Hadoop Configuration | Configuration API deltaLakeConfiguration | The Hadoop Configuration used to read the source Delta Lake table |
Output
| Output Name | Type | Description |
|---|---|---|
imported_files_count | long | Number of files added to the new table |
Added Table Properties
The following table properties are added to the Iceberg table to be created by default:| Property Name | Value | Description |
|---|---|---|
snapshot_source | delta | Indicates that the table is snapshot from a Delta Lake table |
original_location | location of the Delta Lake table | The absolute path to the location of the original Delta Lake table |
schema.name-mapping.default | JSON name mapping derived from the schema | The name mapping string used to read Delta Lake table’s data files |
Example
Here’s a complete example of migrating a Delta Lake table to Iceberg:Migration Workflow
Add required dependencies
Ensure the
iceberg-delta-lake module and Delta Standalone dependencies are available in your classpath.Verify Delta Lake compatibility
Check that your Delta Lake table uses a compatible protocol version:
minReaderVersion: 1minWriterVersion: 2
Prepare catalog and configuration
Set up your Iceberg catalog and Hadoop configuration with proper credentials and access to both source and destination locations.
Verify migration
Query the new Iceberg table to verify:
- Row counts match
- Schema is correct
- Historical snapshots are preserved
- Data is readable
Best Practices
Preserve transaction history
Preserve transaction history
The snapshot action preserves all Delta Lake transactions as Iceberg snapshots, maintaining full lineage and time-travel capabilities.
Plan for storage isolation
Plan for storage isolation
Consider specifying a different
tableLocation for the Iceberg table to achieve full storage isolation from the Delta Lake table.Avoid destructive operations on source
Avoid destructive operations on source
Do not run VACUUM or DELETE operations on the source Delta Lake table after migration, as this will break the Iceberg table’s ability to read the data files.
Monitor migration performance
Monitor migration performance
Large Delta Lake tables with extensive transaction history may take longer to migrate. Monitor the process and plan accordingly.
Test with a subset first
Test with a subset first
Before migrating production tables, test the migration process on a smaller table or subset of data to validate the workflow.