Skip to content

feat(duckdb): isolated on-demand Iceberg query workers with Dex/Polaris authorization #888

Open

Description

@malon64

Goal — v0.8 DuckDB query track (parallel with dbt-spark)

Run read-only, per-person ad hoc SQL via DuckDB on Polaris Iceberg without embedding untrusted SQL in the shared Platform API process. Query=duckdb is independent of the choice of Gold dbt processing adapter; in no-Trino mode it pairs with dbt-spark.

Scope

  • Provision a pinned, minimal DuckDB execution image (offline baked iceberg, httpfs, aws, avro extensions; reuse knowledge from openlakeforge_runtime/duckdb_extensions.py without inheriting Floe/Gold writer keys).
  • Implement per-query Kubernetes Jobs as first POC (or justify a per-identity isolated worker pool if cold starts dominate). Worker receives a short-lived, verified person's Dex token and only stage-bound Polaris REST catalog access, with ACCESS_DELEGATION_MODE 'vended_credentials' on S3-compatible storage.
  • Reuse ADR 0019's per-person grants and SeaweedFS STS configuration. Prove Polaris and DuckDB actually vend scoped storage credentials in OLF's deployment; never fall back to a shared stage-wide S3 key.
  • Set read_only/sandbox controls as defense in depth but do not rely on SQL prefix filtering: DuckDB executes arbitrary I/O and extensions. Use non-root, no host mounts, read-only root FS where feasible, minimal writable scratch, restrictive network egress, fixed extension allowlist, OS/K8s isolation, CPU/RAM/runtime limits.
  • Implement an authenticated control-plane job record and bounded results lifecycle: progress, paging or spooled results, cancel/cleanup, TTL, max concurrent queries, expiry and no leaked result data after a failed/retried job.
  • Validate Iceberg v2 delete semantics, metadata/snapshot refresh, nested schemas, types, Polaris OAuth/OIDC token renewal and proper S3 endpoint/path-style use.

Security gate

  • Reject untrusted DDL/DML, COPY, direct arbitrary file/network reads, INSTALL/LOAD for unapproved extensions, credential enumeration, SQL injection into ATTACH/SECRET and access to other stages. SQL checks alone never count as full containment.
  • Verify owner isolation and no cross-session cache/secret reuse for concurrent analysts/viewers; separate query identity from dbt writer privileges.
  • No Kubernetes API client/ServiceAccount credential visible to executed SQL; any job creator privileges remain in an isolated controller/API.

Acceptance

  • A user can SELECT a permitted Silver/Gold table; another user is denied per Polaris grants, including S3 object access.
  • Worker can't alter tables or read files outside granted location, despite crafted SQL.
  • Jobs bound and cancel safely, emit structured redacted logs and delete ephemeral credentials/results at TTL.
  • No additional DuckDB service or Trino required by query path alone; no assertion that the whole platform is Trino-free while dbt-trino is selected.
  • Cold/warm startup, overhead and concurrency measured on local and multi-node K3s.

Related: #547 #879 #880 ADR 0019 #802 #804. P1, v0.8.

Activity

  1. added this to the milestone on Nov 5, 2026
  2. added
    roadmap
    priority: P1
    track: workloads
    on Nov 5, 2026
  3. modified the milestones: , v0.8-beta — Cloud and On-Premises Beta, v0.9-beta — Cloud Cost and Capacity on Nov 19, 2026
  4. malon64 commented on Nov 19, 2026

    @malon64
    CollaboratorAuthor

    Moved from v0.8-beta to v0.9-beta (2026-11-19): v0.8 qualifies the current stack (Trino + dbt-trino) on cloud and on-premises; separating the compute and query engines follows in v0.9, which already targets scale-to-zero and burst capacity for batch and query.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: P1roadmaptrack: workloadstype: feature

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions