Skip to main content

Overview

Apache Iceberg provides a flexible architecture for building custom catalogs that integrate with your organization’s metadata infrastructure. This guide covers implementing custom components for complete control over metadata management.
To work with encrypted tables, custom catalogs must address specific security requirements.

Custom TableOperations

The TableOperations interface handles low-level metadata read/write operations. Extend BaseMetastoreTableOperations to implement your custom metadata backend:

Key Methods

The doCommit() method must implement atomic compare-and-swap (CAS) semantics to prevent concurrent modification issues.

Custom Catalog Implementation

Extend BaseMetastoreCatalog to create a full catalog implementation:

Loading Custom Catalogs

Spark

Specify catalog-impl property to load your custom catalog:

Java API

Custom FileIO Implementation

Implement FileIO to customize how Iceberg reads and writes data files:

Using Custom FileIO

Specify io-impl in catalog properties:
If your FileIO needs Hadoop configuration, implement org.apache.hadoop.conf.Configurable.

Custom LocationProvider

Control where Iceberg writes data files by implementing LocationProvider:

Setting LocationProvider

Set at table creation time:

Hadoop Configuration Access

If your custom components need Hadoop configuration:

Best Practices

Your doCommit() method must use compare-and-swap semantics to prevent lost updates. Use optimistic locking, conditional updates, or distributed locks.
Multiple writers may attempt to commit simultaneously. Your metastore must handle concurrent commits gracefully with proper retry logic.
Cache metadata locations when possible to reduce metastore load. Implement the invalidateTable() method to clear caches.
If your catalog supports namespaces, implement the SupportsNamespaces interface for better organization.

Complete Example

For a complete working example, see the reference implementations:

Next Steps

JDBC Catalog

See a production-ready custom catalog implementation

Custom FileIO

Deep dive into FileIO implementations