Iceberg sink
Floe writes Iceberg tables for sink.accepted.format: iceberg through an
Iceberg REST catalog (e.g. Polaris).
A catalog is required (0.8). The sink needs a sink.accepted.iceberg block
that resolves to a catalogs.definitions entry, through iceberg.catalog or
catalogs.default. floe validate rejects a catalog-less Iceberg sink with
sink.accepted.format=iceberg requires sink.accepted.iceberg with a catalog in 0.8.
Floe 0.7’s catalog-less filesystem tables are not supported: a path-only table
has no safe commit protocol for concurrent runs.
Example config
Section titled “Example config”storages: default: "s3_out" definitions: - name: "s3_out" type: "s3" bucket: "my-bucket" region: "us-east-1"
catalogs: default: "polaris" definitions: - name: "polaris" type: "rest" uri: "https://polaris.example.com/api/catalog" warehouse: "lakehouse"
entities: - name: "customer" source: format: "csv" path: "/data/in/customers.csv" sink: accepted: format: "iceberg" path: "customer_iceberg" iceberg: {} # uses catalogs.default policy: severity: "warn" schema: columns: - name: "customer_id" type: "string"Table location
Section titled “Table location”The table is created in the catalog on its first write (and its namespace, if missing). Its location is, in order:
sink.accepted.iceberg.location, when set;<warehouse_prefix>/<namespace>/<table>on the catalog’swarehouse_storage, when the catalog setswarehouse_storageorwarehouse_prefix;- otherwise
sink.accepted.pathonsink.accepted.storage.
The namespace defaults to entity.domain, then default; the table name to entity.name.
The storage must be S3, GCS or ADLS: floe validate rejects a local accepted storage unless the
catalog’s warehouse_storage points at S3, GCS or ADLS. On ADLS, PyIceberg writes through adlfs
(the adls extra) at abfss://<container>@<account>.dfs.core.windows.net/...; see
ADLS. On GCS, overwrite and append work; merges
and compaction fail the run (see GCS).
AWS credentials for S3 writes
Section titled “AWS credentials for S3 writes”Floe passes the S3 storage’s endpoint, region and path_style_access to PyIceberg and
DuckDB. Credentials come from the standard AWS credential chain (environment variables, web
identity / IRSA, container credentials, instance metadata); the catalog does not vend them.
AWS Glue catalog
Section titled “AWS Glue catalog”A type: glue catalog writes the table through the AWS Glue Data Catalog, as Floe 0.7 did:
catalogs: default: "glue" definitions: - name: "glue" type: "glue" region: "eu-west-1" database: "sales_silver" # the Glue database that holds the tables warehouse_storage: "lakehouse_silver" warehouse_prefix: "warehouse/iceberg" create_database_if_missing: false # default trueThe table is <database>.<table>; sink.accepted.iceberg.namespace (or entity.domain) only
names its location, <warehouse_prefix>/<namespace>/<table>. To write one database per domain from
a single catalog, put {domain} in database, e.g. database: dev_{domain}_silver: per
entity it becomes sink.accepted.iceberg.namespace, else entity.domain, normalized like the
namespace (lowercase, [a-z0-9_-]), so the sales and finance domains write to dev_sales_silver
and dev_finance_silver. An entity with neither a namespace nor a domain is a floe validate
error. {{VAR}} placeholders are not applied to catalog definitions: to vary the prefix per stage,
define the catalog in each stage’s profile (profile catalogs
replace the config’s). Glue credentials come from the AWS credential chain, as for S3. Glue supports overwrite and append: floe validate rejects a
merge write mode, and floe maintain --compact needs a REST catalog. allow_takeover is
accepted and ignored: Floe writes any Iceberg table in the database (D42).
REST catalog credentials
Section titled “REST catalog credentials”REST catalog definitions accept bearer tokens and OAuth2 client credentials:
catalogs: default: "polaris" definitions: - name: "polaris" type: "rest" uri: "http://polaris:8181/api/catalog" credential: "client_credentials:${POLARIS_CLIENT_ID}:${POLARIS_CLIENT_SECRET}" warehouse: "lakehouse" oauth2_server_uri: "http://polaris:8181/api/catalog/v1/oauth/tokens" scope: "PRINCIPAL_ROLE:ALL"Prefer ${ENV_VAR} placeholders in credential over literal client IDs/secrets
in YAML. They are resolved from the OS environment at run time, including during
floe run --manifest, so runner environments can inject REST catalog secrets
without baking raw credentials into config or the manifest. The resolved credential
is held as a secret and is never written to reports or logs.
Partition spec config
Section titled “Partition spec config”Iceberg accepted sinks can declare a partition spec in config, and Floe executes it at write time for Iceberg table creation/data file layout:
sink: accepted: format: "iceberg" path: "customer_iceberg" iceberg: {} partition_spec: - column: "event_date" transform: "day" - column: "country" transform: "identity" - column: "customer_id" transform: "bucket" num_buckets: 16Current scope:
- partition columns must exist in
schema.columns - supported transforms:
identity,year,month,day,hour,bucket(withnum_buckets, D12) - partition spec is applied to Iceberg table metadata and partitioned file writes
- writes validate partition-spec compatibility with existing tables (no implicit partition-spec evolution)
Supported scope (current)
Section titled “Supported scope (current)”- Accepted sink only (
sink.accepted.format: iceberg), through a REST or AWS Glue catalog - S3, GCS or ADLS storage for the table data (S3 with a REST catalog is the tested path; ADLS and GCS are
untestedend to end, see the support matrix) sink.write_mode:overwrite,append,merge_scd1andmerge_scd2. See write modes.- Each entity’s write is one catalog commit.
overwritereplaces every existing data file in that snapshot;appendadds files;merge_scd1runs a DuckDBMERGE INTO(merge-on-read). appendsnapshots carryfloe.run_idandfloe.input_hash, so a retry finds a batch a dead run already committed and skips it (skip_reason: already_committed).- Unique checks on
appendread the table’s existing keys, and a commit conflict re-checks the keys of concurrently added files. sink.accepted.options.compressionandrow_group_sizeshape the Parquet data files ofoverwriteandappendwrites (PyIceberg’swrite.parquet.compression-codecandwrite.parquet.row-group-limit, applied to that write only; the table’s properties are not changed). Unset, the table’s properties and PyIceberg’s defaults apply.merge_scd1andmerge_scd2write through DuckDB and ignore both options.schema.schema_evolution.mode: add_columnsadds new columns as nullable (D13)- Unsigned integer columns are widened (
uint8/uint16→int,uint32→long); Iceberg has no unsigned types - Run report
accepted_outputincludes:table_root_uri,write_mode,files_written,parts_writtentable_version(Iceberg metadata version, when available)snapshot_id(when a snapshot exists)iceberg_catalog_name,iceberg_namespace,iceberg_table- file sizing metrics (
total_bytes_written,avg_file_size_mb,small_files_count)
- Iceberg file sizing metrics are based on Iceberg data files only (metadata/manifests excluded)
Limitations / non-goals (current)
Section titled “Limitations / non-goals (current)”strategy: dropinpiiis rejected: the table enforces the full declared schema- Every commit rewrites the table metadata, which lists every retained snapshot: an
overwriteof a table with 100 snapshots took about 230 ms of commit and write time against about 50 ms with 2 on a local catalog. Runfloe maintainto expire snapshots on tables written often - Snapshot expiry and orphan file removal with
floe maintain(see CLI usage); compaction is experimental (--compact --experimental)
Guarantees and evidence
Section titled “Guarantees and evidence”What is atomic, what a retry does and which backends are tested: support matrix.
Integration tests
Section titled “Integration tests”The Polaris and S3 tests are skipped by default. Start a local Polaris + S3 harness, then run
FLOE_POLARIS_URI=http://localhost:8181/api/catalog uv run pytest -m polaris (and set
FLOE_S3_ENDPOINT for the -m s3 tests).
Empty accepted dataset behavior
Section titled “Empty accepted dataset behavior”- The table is created on the first write even when no row is accepted.
- An
appendof no rows commits nothing. - An
overwriteof no rows removes every existing data file in one snapshot; on an empty table it commits nothing.
Synced from floe @ v1.1.0 (313b534), docs/sinks/iceberg.md.