Repository navigation
Conversation
Read snapshot-visible scalar and table macro definitions from every metadata provider. Expand typed and defaulted parameters during DataFusion planning, and report stored-SQL errors with the macro name and dialect. Add DuckDB oracle coverage for scalar, table, schema-qualified, defaulted, and unsupported macro forms.
faysou
requested review from
anoop-narang,
shefeek-jinnah and
zfarrell
as code owners
November 23, 2026 15:05
Start a new CI run after the hosted macOS job was canceled.
The macOS feature set enables DuckDB metadata reads and SQLite writes. Compile the DuckDB writer fixture only when write-duckdb is enabled.
This branch has not been deployed
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
Use
register_ducklake_macrosto register snapshot-visible scalar and table macros inDataFusion. The catalog provider loads implementations and parameters. DataFusion binds defaults
in parameter order and resolves table-macro SQL in the registered DuckLake catalog. It reports
a planning error for macro SQL it cannot run.
Macro registration and expansion
flowchart LR Snapshot["Catalog snapshot"] --> Rows["Read visible definitions and ordered parameters"] Rows --> Register["Register scalar and table macros"] Register --> Bind["Bind call arguments and defaults"] Bind --> Plan["Plan scalar expression or catalog-scoped table query"]Verification
All-feature Clippy and all three macro tests pass with all features enabled.
duckdb_macros_match_scalar_and_table_oraclescompares scalar and table calls, includingdefaults and schema-qualified calls, with DuckDB.
duckdb_writer_initializes_macro_tablesandsqlite_writer_initializes_macro_tablesexercise catalog initialization on both backends.
The integration test target compiles with the macOS CI feature set. DuckDB writer
initialization requires
write-duckdb. The macro oracle and SQLite initializationcompile with DuckDB metadata reads and SQLite writes enabled.
Specification proof
Reference implementation
DuckDB's DuckLake extension resolves the same catalog rows before building scalar and table
macros. DataFusion handles SQL expansion in this PR and reports planning errors for SQL it
cannot run. Macro catalog query,
Implementation and parameter loading,
Macro reconstruction.