Register existing Iceberg tables
If another system already writes Iceberg tables, such as an ELT tool, a streaming job or another engine, you do not need to copy them into Bauplan. Register the table from its current metadata file as an external table. Registering copies no data. The table points at the other system's metadata and data files, and you can query it, join it and read it from pipelines on any branch. This page registers a table and advances it when the other system writes new snapshots.
Give Bauplan read access to the files
Your Bauplan deployment needs read access to the bucket and prefix that hold the table's metadata and data files, for as long as you query the table. If the files are in a bucket other than the one Bauplan was set up with, give the Bauplan execution role read permissions on it.
The metadata file must be outside Bauplan's warehouse prefix. Registration refuses metadata inside it.
Bauplan's query engine cannot read tables written with Iceberg delete files (merge-on-read updates and deletes). Configure the writing system to rewrite data files on updates (copy-on-write), or have it compact the table before you register it.
Find the current metadata location
You need the table's current metadata file (.../metadata/<version>.metadata.json). Ask the catalog the other system writes to for its location. With PyIceberg against an Iceberg REST catalog:
from pyiceberg.catalog import load_catalog
source_catalog = load_catalog(
"source",
type="rest",
uri="https://catalog.example.com/api/catalog",
credential="<client_id>:<client_secret>",
warehouse="<warehouse>",
)
metadata_location = source_catalog.load_table(("sales", "orders")).metadata_location
Register the table on a branch
Register the table on a data branch, check it, and merge it like any other change:
from datetime import datetime, timezone
import bauplan
client = bauplan.Client()
stamp = datetime.now(timezone.utc).strftime("%Y%m%d%H%M%S")
branch = f"{client.info().user.username}.orders-registration-prod-{stamp}"
client.create_branch(branch=branch, from_ref="main")
client.create_external_table_from_metadata(
table="orders",
metadata_json_uri=metadata_location,
namespace="partner",
branch=branch,
overwrite=True,
)
rows = client.query("SELECT COUNT(*) AS rows FROM partner.orders", ref=branch)
Registration is a catalog operation, not a job. It returns as soon as the table is registered.
The same with the CLI:
bauplan table create-external orders --namespace partner --metadata-json-uri 's3://partner-bucket/warehouse/sales/orders/metadata/00042.metadata.json' --branch <username>.register-orders
Advance to new snapshots
A registered table is frozen at the metadata file you registered. When the other system commits new snapshots, Bauplan does not see them until you register the table again with the new metadata location. Run the registration after each write of the other system, or on a schedule:
- Read the current metadata location from the source catalog.
- Register it on a fresh branch with
overwrite=True. - Run your checks against the branch.
- Merge into
main.
The table is read-only in Bauplan. You cannot import into it or fix rows in it. Make corrections in the system that writes it.
Iceberg metadata records absolute file paths, including the storage scheme and bucket. Moving the files to another bucket or storage system breaks the metadata, and registering the table again does not fix it.
If you need partitioning, time travel that does not depend on the other system keeping its files, or a table that survives the source being dropped, read the registered table in a pipeline and write it to a managed table. This stores a second copy of the data. See how to choose between managed and external tables.