Skip to main content

opteryx-iceberg

Read-only Apache Iceberg Metastore/FileIO backend for opteryx-catalog, letting an Opteryx workspace query tables from an external Iceberg catalog (REST, SQL, Hive, Glue - whatever pyiceberg's own catalog loader supports) side by side with native Firestore/GCS-backed tables.

This is Tier 1 of Opteryx's Iceberg support: reads only. Writing real Iceberg tables from Opteryx (Tier 2) and serving Opteryx's own catalog as an Iceberg REST endpoint (Tier 3) are separate, later work.

Kept as its own package - not merged into opteryx-catalog or opteryx-core - because it depends on pyiceberg, which pulls in pyarrow/pydantic. Both of those repos are deliberately free of that dependency chain; Iceberg support is optional, the same way opteryx-access is.

Usage

Register a workspace against an external Iceberg catalog using Opteryx's existing connector-registration API:

from opteryx.connectors import register_workspace
from opteryx.connectors.opteryx_connector import OpteryxConnector
from opteryx_iceberg import IcebergMetastore

register_workspace(
    "my_iceberg_workspace",
    OpteryxConnector,
    catalog=IcebergMetastore,
    catalog_type="rest",       # or "sql", "hive", "glue" - anything pyiceberg's loader supports
    uri="https://...",
    warehouse="s3://...",
)

Do not pass workspace= yourself — OpteryxConnector injects it automatically (as the registered prefix) when it instantiates IcebergMetastore; passing it explicitly raises a duplicate-keyword-argument error.

Native (Firestore/GCS-backed) workspaces are entirely unaffected - this only applies to workspaces explicitly registered with catalog=IcebergMetastore.

Keep every kwarg flat and hashable. register_workspace stores its kwargs verbatim, and opteryx-core's connector cache hashes them (tuple(sorted(connector_entry.items())) in opteryx-core/opteryx/connectors/__init__.py's connector_factory) — a dict or list value there raises TypeError: unhashable type: 'dict'. This is why Google auth is configured via the flat auth_type="google" / google_auth_scopes=(...) kwargs below rather than pyiceberg's own nested auth={"type": "google", "google": {...}} dict — IcebergMetastore builds that nested dict internally, after the hashing has already happened.

Google auth (BigLake and other Google-fronted REST catalogs)

register_workspace(
    "tarchia",
    OpteryxConnector,
    catalog=IcebergMetastore,
    catalog_type="rest",
    uri="https://biglake.googleapis.com/iceberg/v1/restcatalog",
    warehouse="bl://projects/<project>/catalogs/<catalog>",
    auth_type="google",
    google_auth_scopes=("https://www.googleapis.com/auth/cloud-platform",),
    **{"header.x-goog-user-project": "<project>"},
)

auth_type="google" wraps pyiceberg's built-in GoogleAuthManager, which authenticates via Application Default Credentials and refreshes the token on every request — safe for a long-lived server (a manually fetched gcloud auth print-access-token bearer token, by contrast, expires within the hour and is only good for one-off scripts/tests). In production this picks up Cloud Run's attached service account automatically, the same way the rest of the deployment already does — no explicit credentials_path needed.

This is wired into worker.opteryx as the tarchia workspace, alongside the native mabel_data registration - reads from it go through the exact same query path as any native table (verified with a real SELECT ... FROM tarchia.interop_ns.people).

Local-dev only for now: worker.opteryx reaches opteryx_iceberg via the same sys.path sibling-checkout convention as opteryx-core/opteryx-catalog/opteryx-access (never pip install -e) - see its pyproject.toml, which does not yet list opteryx-iceberg as a real dependency, since it isn't published anywhere yet. A production Cloud Run deploy of worker.opteryx would need that resolved first (publish opteryx-iceberg somewhere installable, or vendor it) - the tarchia registration works today for local runs only.

What's supported

  • SELECT queries against existing Iceberg tables, including predicate pushdown/pruning via standard Iceberg manifest bounds (min_values/max_values/null_counts).
  • Schema introspection (DESCRIBE, information_schema).

What's not (yet)

  • Any write path: CREATE/DROP/ALTER/INSERT/rename all raise NotImplementedError — that's Tier 2.
  • Iceberg views (Iceberg's view spec has no equivalent here yet).
  • Opteryx's own sketch-based pruning stats (min_k_hashes/histograms) — standard Iceberg manifests don't carry them; queries fall back to standard bounds-based pruning.
  • Nested Iceberg types (struct/map/list) — IcebergDataset.schema() raises rather than silently misrepresenting them.

Local development

Sibling opteryx-catalog/opteryx-core checkouts are referenced via sys.path insertion in test files (see tests/), never pip install -e - see those repos' own conventions.

Testing

python -m pytest tests/ -v

Tests run against pyiceberg's own local SqlCatalog (SQLite metadata + local-disk FileIO) — no server, no Docker required.

Real REST-catalog interop check

Snowflake Open Catalog is closed to new signups as of 2026 (Snowflake now points new customers at Horizon Catalog, which needs a full paid-account trial). Instead, real wire-protocol compatibility is verified against Google Lakehouse for Apache Iceberg (BigLake), reusing the existing mabeldev GCP project:

  • Catalog: projects/mabeldev/catalogs/opteryx-iceberg-tier1-test (type biglake, credential-mode end-user), storing data under gs://tarchia/iceberg-tier1-test.
  • Verified manually (not in CI - needs a live GCP access token): dataset_exists, load_dataset, schema() type mapping, scan() including real Iceberg bounds-byte decoding (min_values/max_values/field_ids), and get_relation for both hit and miss, all through opteryx_iceberg.IcebergMetastore against a table (interop_ns.people) written independently via plain pyiceberg.catalog.rest.RestCatalog.
  • Connecting needs GOOGLE_APPLICATION_CREDENTIALS set in-process (not just gcloud auth activate-service-account) — PyArrowFileIO's GCS backend otherwise hangs trying to reach the GCE metadata server for ADC. Warehouse URI format is bl://projects/<project>/catalogs/<catalog> (not a bare projects/... path).
  • This catalog/table is being kept around (not torn down) for reuse in future Tier 1/Tier 2 verification.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

opteryx_iceberg-0.1.1.tar.gz (22.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

opteryx_iceberg-0.1.1-py3-none-any.whl (18.0 kB view details)

Uploaded Python 3

File details

Details for the file opteryx_iceberg-0.1.1.tar.gz.

File metadata

  • Download URL: opteryx_iceberg-0.1.1.tar.gz
  • Upload date:
  • Size: 22.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for opteryx_iceberg-0.1.1.tar.gz
Algorithm Hash digest
SHA256 9f639e1db13b7aa8b78f3c77442003fc8824d77fef30f6e90b6bebcbdd249e8c
MD5 c210c85976e75896d3d588f81b3e512d
BLAKE2b-256 49943d4137e061aea954f03a149f491f91feca55d4639599cb792c16109fe575

See more details on using hashes here.

Provenance

The following attestation bundles were made for opteryx_iceberg-0.1.1.tar.gz:

Publisher: release.yaml on mabel-dev/opteryx-iceberg

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file opteryx_iceberg-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: opteryx_iceberg-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 18.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for opteryx_iceberg-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 46cd079355da683b557828f33b3003220cfe0297b8ece5b916e01e31b4b89e7f
MD5 fdb61b5e0e8e568ecec5e33d06b17ada
BLAKE2b-256 f83ffc487c12566cdaefdffc1c5bc2522fefdd43a4563e35cc5b49bb3243e086

See more details on using hashes here.

Provenance

The following attestation bundles were made for opteryx_iceberg-0.1.1-py3-none-any.whl:

Publisher: release.yaml on mabel-dev/opteryx-iceberg

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.1.9

2 files

0.1.8

2 files

0.1.7

2 files

0.1.5

2 files

0.1.3

2 files

0.1.2

2 files

This release

0.1.1 This release

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page