About this project

duckbridge is a Trino connector plugin that lets you run SQL queries against DuckDB databases – either embedded files or remote servers speaking the Quack RPC protocol – with pushdown of projections, domain predicates, LIMIT/ORDER BY … LIMIT, and a wide range of scalar functions. Unlike typical JDBC‑based connectors, duckbridge pushes supported operations into DuckDB rather than pulling data into Trino for evaluation, and ensures correctness by verifying that DuckDB evaluates expressions identically to Trino (including NULLs, Unicode, and date/time zone rules). The connector is packaged as a standard Trino plugin for deployment on coordinator and workers. **Key features:** - **Connectivity:** Embedded DuckDB via JDBC (`jdbc:duckdb:`) or remote DuckDB via the Quack protocol (`jdbc:quack://`). Remote servers simply run `CALL quack_serve(…)`; no connector‑side installation is required. - **Pushdown:** Projection and predicate pushdown always on. LIMIT, TopN, and a large catalog of scalar functions are pushed as native DuckDB SQL. A small set of functions (e.g., ICU case folding, crypto hashes) that DuckDB cannot match natively is backed by the optional `trino_parity` DuckDB extension. - **String pushdown modes:** A configurable dial controls how string predicates are handled – from no pushdown (`NULL_ONLY`) to full pushdown with runtime verification (`PARITY`). The default `PARITY` mode probes DuckDB’s binary collation and extension availability on first connection, failing loudly if divergence is detected. - **Extension:** The `trino_parity` extension is published on DuckDB’s community‑extensions repository. For embedded mode, the signed Linux binaries are bundled in the release; on other platforms, you can install it once or run in `GUARDED` mode. Remote servers must load the extension at startup (or provide a server‑side path). - **Optional data scanning:** Experimental table functions for Lance datasets and Vortex files, including vector, full‑text, and hybrid search, can be enabled per catalog. - **Dynamic catalog management:** Catalogs can be created at runtime via `CREATE CATALOG … USING duckbridge` when Trino’s dynamic catalog management is enabled. - **Type mapping:** Lossless mapping for DuckDB types including UUID, `TIMESTAMPTZ`, `UBIGINT` (as `DECIMAL(20,0)`), and `VARBINARY`. Unsupported types like `HUGEINT` are rejected. Duckbridge is built for Trino 483 and embeds DuckDB 1.5.5. The project includes an experimental Arrow‑based columnar engine for direct data transfer, and future plans include aggregate pushdown and a Doris‑compatible variant.