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
For detailed usage and other optional configurations, please refer to the SnapshotDeltaLakeTable API.
Output
Added Table Properties
The following table properties are added to the Iceberg table to be created by default:Example
Here’s a complete example of migrating a Delta Lake table to Iceberg:Migration Workflow
1
Add required dependencies
Ensure the
iceberg-delta-lake module and Delta Standalone dependencies are available in your classpath.2
Verify Delta Lake compatibility
Check that your Delta Lake table uses a compatible protocol version:
minReaderVersion: 1minWriterVersion: 2
3
Prepare catalog and configuration
Set up your Iceberg catalog and Hadoop configuration with proper credentials and access to both source and destination locations.
4
Execute snapshot
Run the
snapshotDeltaLakeTable action with the appropriate configuration:5
Verify migration
Query the new Iceberg table to verify:
- Row counts match
- Schema is correct
- Historical snapshots are preserved
- Data is readable
6
Update applications
Switch read and write workloads to the new Iceberg table.
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.