feat: add ducklake_fdw for read-only access to DuckLake tables#59
Merged
feat: add ducklake_fdw for read-only access to DuckLake tables#59
Conversation
Add a PostgreSQL Foreign Data Wrapper that provides read-only access to DuckLake tables, supporting both regular PostgreSQL-backed metadata catalogs and frozen HTTP-hosted .ducklake snapshots. Key design decisions: - Queries route through DuckDB via pg_duckdb's external-table-check hook rather than FDW scan callbacks, preserving DuckDB's vectorized execution for full query plans. - Column inference at CREATE FOREIGN TABLE time probes the remote schema via a temporary DuckDB connection, so users never specify column definitions manually. - DML is blocked at plan time with clear error messages. - Reuses pg_duckdb's GetPostgresDuckDBType/Typemod for type mapping (exported with default visibility in the submodule update). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
d38e061 to
b1519ce
Compare
The previous commit referenced the old submodule pointer. This updates it to include the hooks and visibility exports needed by ducklake_fdw. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
dfc3b25 to
40d28d7
Compare
40d28d7 to
342ac05
Compare
The function signature differs across PG versions: - PG 14-16: 10 args (no fdw_restrictinfo) - PG 17: 11 args (added fdw_restrictinfo) - PG 18: 12 args (added disabled_nodes) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove unrelated .dockerignore changes (belong to duckdb-postgres PR) - Eliminate namespace forwarding wrapper for RegisterForeignTablesInQuery - Restore original header comment in pgducklake_duckdb.hpp - Fix #pragma once placement in pgducklake_fdw.hpp Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add
ducklake_fdw, a read-only Foreign Data Wrapper for DuckLake tables. Supports both PostgreSQL-backed metadata catalogs and frozen HTTP-hosted.ducklakesnapshots.Queries route through DuckDB via pg_duckdb's external-table-check hook, preserving vectorized execution. Column definitions are auto-inferred at
CREATE FOREIGN TABLEtime.Test plan
fdwandfrozen_fdw)