Skip to main content

Apache Iceberg Loader

The Apache Iceberg Loader is responsible for persisting extracted data into high-performance lakehouse tables. It interfaces directly with Apache Iceberg catalogs to handle metadata management and writes underlying data files efficiently while ensuring seamless schema alignment.

Configuration​

Sinks are defined in sink.yml (or gojjam_ingest_sinks.yml). The Apache Iceberg loader dynamically configures the table catalog and routes the data storage layout directly to the defined warehouse infrastructure.

Basic Usage​

version: "1.0"
sinks:
# Local development environment (SQLite / Local Filesystem)
- name: "iceberg_local_dev"
type: "iceberg"
source_folder: "./ingest"
catalog_type: "sqlite"
catalog_name: "local"
catalog_uri: "sqlite:///iceberg.db"
namespace: "bronze"
write_mode: "APPEND"
warehouse_config:
warehouse_type: "local"
warehouse: "./warehouse"

# Cloud Storage with Production PostgreSQL Catalog
- name: "iceberg_s3_prod"
type: "iceberg"
source_folder: "./ingest"
catalog_type: "postgres"
catalog_name: "production"
catalog_uri: "postgresql://admin:password@localhost:5432/warehouse"
namespace: "bronze"
write_mode: "APPEND"
warehouse_config:
warehouse_type: "s3"
warehouse: "s3://my-data-bucket/warehouse"
s3.access-key-id: "your_access_key"
s3.secret-access-key: "your_secret_key"
s3.endpoint: "https://s3.amazonaws.com"
s3.region: "us-east-1"
s3.force-virtual-addressing: false

Key Features​

1. Flexible Write Modes​

Gojjam supports two native table manipulation strategies matching the Iceberg specification:

  • APPEND: Appends new data rows to the target dataset as a new table snapshot.
  • OVERWRITE: Performs an atomic snapshot overwrite, replacing the current table data with the newly extracted data block.

2. Multi-Warehouse Routing​

The loader supports decoupled storage targets via structural configuration mapping:

  • local: Ideal for prototyping, local testing, and file-based pipelines.
  • s3: Production-grade cloud storage utilizing robust S3 API endpoints.

3. Native Schema Integrity​

Data streaming through the Iceberg loader automatically maintains rigid layout properties. The loader handles target table synchronization directly from PyArrow structures, guarding datasets against type mismatch anomalies or missing system fields.


Configuration Reference​

Top-Level Fields​

FieldTypeDescription
nameStringA unique identifier for the Iceberg sink (e.g., iceberg_silver).
typeStringThe target system type. Must be iceberg.
source_folderStringThe directory path where the loader looks for data layouts or structures to ingest.
catalog_typeEnumThe database backing the Iceberg catalog. Options: postgres or sqlite.
catalog_nameStringName of the internal Iceberg catalog instance wrapper.
catalog_uriStringThe full connection URI string to access the metadata database catalog.
namespaceStringThe target Iceberg namespace (similar to a database schema or folder grouping).
write_modeEnumDetermines target table snapshot handling: APPEND or OVERWRITE. Default is APPEND.
warehouse_configObjectNested configuration containing backend storage properties.

Warehouse Configurations (warehouse_config)​

Local Filesystem Variant (warehouse_type: "local")​

FieldTypeDescription
warehouse_typeStringExplicit identifier. Must be local.
warehouseStringLocal directory path matching the file layout landing root.

AWS S3 Variant (warehouse_type: "s3")​

FieldTypeDescription
warehouse_typeStringExplicit identifier. Must be s3.
warehouseStringThe cloud uri path (e.g., s3://my-bucket-name/prefix).
s3.access-key-idStringAWS user access credential identity token.
s3.secret-access-keyStringAWS user secret token credential payload.
s3.endpointStringCustom destination target host (useful for alternative object storage or LocalStack).
s3.regionStringTarget AWS geographic region context locator.
s3.force-virtual-addressingBooleanSets URL path structures for bucket paths. Default is true.

Implementation Note:​

All properties declared inside warehouse_config are tightly mapped and checked at boot time using strict discriminator validation rules. Invalid or misaligned config keys targeting storage options will fail explicitly prior to ingestion setup routines.